Aggregator Stage

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
gauravrb
Participant
Posts: 28
Joined: Wed Dec 27, 2006 11:31 pm
Location: Mumbai

Aggregator Stage

Post by gauravrb »

In Aggregator Stage i am passing five input columns A,B,C,D and E.
I am grouping on A,B,C,D keys. After Grouping i want to retain the First Value of E in the group. Is this possible? If possible which aggregate function to use? because in Aggregator stage i did find any specific function to retain the first value.
Gaurav.
MOHAMMAD.ISSAQ
Participant
Posts: 78
Joined: Fri Mar 02, 2007 4:54 am
Location: CHENNAI

Post by MOHAMMAD.ISSAQ »

Can you tell your requirements clearly
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Remove Duplicates stage gives the capability to preserve the first or last in each group.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gauravrb
Participant
Posts: 28
Joined: Wed Dec 27, 2006 11:31 pm
Location: Mumbai

Post by gauravrb »

ray.wurlod wrote:Remove Duplicates stage gives the capability to preserve the first or last in each group. ...
So i will need to use Remove Duplicate Stage along with Aggregator Stage to meet this requirement and this functionality cannot be achieved in Aggregator Stage.
Gaurav.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

INSTEAD of Aggregator stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gauravrb
Participant
Posts: 28
Joined: Wed Dec 27, 2006 11:31 pm
Location: Mumbai

Post by gauravrb »

ray.wurlod wrote:INSTEAD of Aggregator stage. ...
Sorry I forgot to mention that i have some other columns F,G on which i need to aggregation for SUM and COUNT. And for Column E i need to retain the First value in that group. So I wanted to find if any such function for retaining the FIRST value is present in Aggregator Stage.
Gaurav.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Changing the specification risks invalidating the answer.

There is no First or Last set function in the parallel Aggregator stage.

Is that clear now?

Your solution will, therefore, require both stage types. Use a "fork join" design; split the stream into two, run one stream through an Aggregator stage and the other stream through a Remove Duplicates stage, then bring both streams back together in a Join stage.
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