Hi All,
I have a scenario with sequential file as input data as below:
Name Sub1 Sub2 Sub3
abc 70 80 90
def 50 70 80
ghi 50 80 90
I need to sum the columns sub1+sub2+sub3 and get the value in new column 'Total' in output file as below:
Name Sub1 Sub2 Sub3 Total
abc 70 80 90 240
I tried using transformer but it was cubersome and could not do it, can anyone help how to achieve this using aggregator stage.
Thanks in advance.
Use of aggregator stage to sum columns value
Moderators: chulett, rschirm, roy
Re: Use of aggregator stage to sum columns value
Please let us know what you put as the derivation for the new "Total" column in the transformer.
You are not aggregating rows, rather summing columns, so the aggregator is not going to help in this instance.
You are not aggregating rows, rather summing columns, so the aggregator is not going to help in this instance.
You don't need stage variables, just a simple derivation in the new column to add the other three together. And this is not something you can do in the Aggregator, it does sums across rows not within.
Last edited by chulett on Thu Jan 16, 2014 12:37 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers