My source sequential file contains 4 fields:
Code: Select all
id,division,date,amount
--------------------------
1,0,10-10-2011,1
1,0,11-10-2011,12
1,0,12-10-2011,23
1,1,1-1-2011,12
1,1,2-1-2011,13
Code: Select all
id,division,date,amount,amount1
-------------------------------------
1,0,10-10-2011,1,1
1,0,11-10-2011,12,13
1,0,12-10-2011,23,36
1,1,1-1-2011,12,12
1,1,2-1-2011,13,25
Code: Select all
seqfile------linksort on id,division and date--->Sortstage(id,division)-->xfm-->xfm1--->tgt_dataset
For the first record in each group the amount1 will be same as amount field.
The remaining records will have 0 in amount1.
in the second transformer, i am calculating the amount1 using stage variables.
Is it possible to achieve the same using a single transformer stage
Thanks