Page 1 of 1

how to get max count of 3 columns

Posted: Wed Dec 28, 2011 3:29 pm
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

Posted: Wed Dec 28, 2011 5:07 pm
by ray.wurlod
Use Aggregator and specify Max rather than Count.

Posted: Thu Dec 29, 2011 1:40 pm
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.