Calculating the sum of rows in a particular column

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Calculating the sum of rows in a particular column

Post by Hope »

I have to calculate the sum of all the rows in a particular column .If I use the Aggregate Stage I have to provide the grouping key but there is no Grouping key.it is simply calculating the sum of all rows in a column of a source file. Can I use the aggregator stage for this ?

Please help.
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Calculating the sum of rows in a particular column

Post by sud »

In a transformer prior to the aggregate stage you can create a column with a high wired value of 1 and use that as the grouping key.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

Thanks
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

xx
Last edited by Hope on Thu Aug 30, 2007 3:40 pm, edited 3 times in total.
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

I tried the logic which was suggested. I was able to do it.

Thanks for the help.
Post Reply