0

I want to implement this logic other than aggregator stage, basically through transformer stage to merge these records based on the ID column, and there is no possibility to get multiple values for same field in my case for same ID column.

I have this input data,

ID|VAL1|VAL2|VAL3|BAL1|BAL2|BAL3

10001|5|0|0|1000|0|0

10001|0|10|0|0|1200|0

10001|0|0|11|11|0|10500

and i want my output to be like:

ID|VAL1|VAL2|VAL3|BAL1|BAL2|BAL3

10001|5|10|11|1000|1200|10500

Is it possible to implement it and if, then thanks in advance!!!!

Pr. N
  • 17
  • 3

1 Answers1

0

There are at least two options to do that:

  1. Using the loop within the transformer
  2. Storing the data of the previous row (with the help of stage variables) until LastRowInGroup

Some common things are

  • get the data sorted upfront the transformer
  • Use LastRowInGroup to use it as output constraint
  • remember that the stage & loop variables are processed top down so the sequence matters and enables one to point to an old (previous) content when referring to a variable further down from above

Be aware that this a little advanced - the aggregator would be probably the easier solution.

MichaelTiefenbacher
  • 3,805
  • 2
  • 11
  • 17
  • Hi Michael, Thanks for the steps can you please elaborate it practically. I'm new to datastage so just exploring different options to solve this. – Pr. N Feb 22 '20 at 08:02
  • Sorry I can answer specific questions but I cannot educate you on DataStage here or build your job. I really recommend to get a DataStage class because it is an mighty and big ETL tool with lots of options. – MichaelTiefenbacher Feb 22 '20 at 15:17