Aggregator help

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
dsdev_123
Participant
Posts: 25
Joined: Tue Oct 09, 2007 9:13 pm

Aggregator help

Post by dsdev_123 »

I have 8 columns in the dataset.
col1,
col2,
col3,
col4,
col5,
col6,
col7,
col8

I want to have columns in the output h seq file as below.

colA = col1
colB= col2
ColC =col3
ColD = sum(col8) group by col1,col2,col3,col4,col5,col6,col7 having col4 =1
ColE= sum(col8) group by col1,col2,col3,col4,col5,col6,col7 having col4 =1 minus(-) sum(col8) group by col1,col2,col3,col4,col5,col6,col7 having col4 =1 and col5=1
ColF= sum(col8) group by col1,col2,col3,col4,col5,col6,col7 having col4=1 and col5=1 and col6 =1
ColG= col4
ColH = col5
ColI = 1 if col5 =1
2 if col5 =0
colJ= col6
colK = col7.

i am trying to figure out by aggregator stage. plz can any body help me..

Thanks
sarathh
nagaprasad
Ramani
Participant
Posts: 58
Joined: Mon Oct 08, 2007 1:51 am

Post by Ramani »

Use aggregator stage for each groups that you have and then use join stage to join all aggregator outputs.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You won't be able to do it in one Aggregator stage, since you need sum(col8) in one of your calculations. So you will need at least two Aggregator stages.

Tip: include an explicit Sort stage on the input to the second Aggregator stage to specify "don't sort (previously sorted)".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply