How can I output fields not grouped in aggregator?

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
dsuser7
Participant
Posts: 41
Joined: Sat Nov 29, 2008 2:21 am

How can I output fields not grouped in aggregator?

Post by dsuser7 »

Hi,

I'm trying to output fields other than those used for grouping/keys in an aggregator stage. I'm using this stage to find the maximum value of one field.

Is this possible?

ex: Max on 4th field; keys are 1st and 2nd fields
input:
123,a,asdf,45,ghk
123,a,ghg,55,dbd
234,b,olkd,90,gjsl
234,b,tklo,60,mnrf


output:
123,a,ghg,55,dbd
234,b,olkd,90,gjsl

Thanks
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Try this link for explanation of issues and possible solutions: viewtopic.php?p=435197

However, your example doesn't seem to need an aggregator. In the example provided you can sort on the two keys and the fourth field and then eliminate duplicates on the first two keys, keeping the record that contains the maximum value in the fourth field (either first or last duplicate depending on sort order).
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
Post Reply