how to get max count of 3 columns

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
developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

how to get max count of 3 columns

Post by developeretl »

Hi,
Im extracting A,B,C columns from dataset. All the three columns have values which occur more than once. So I need to populate the column A only for the maximum occurence of B and maximum occurence of C. I have used aggregator to get the count. But the count can be done for only one column. If there any other way ?

Example

A B C
1 1 2
1 1 1
1 1 2

Result : A B C
1 1 2
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use Aggregator and specify Max rather than Count.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
soumya5891
Participant
Posts: 152
Joined: Mon Mar 07, 2011 6:16 am

Post by soumya5891 »

In a sort stage sort on A(Ascending) then B(Descending) and C(Descending).And hash partition on A.Now use a remove duplicate stage on the basis of A.You will get the maximum occurrence.
Soumya
Post Reply