Page 1 of 1

merge duplicate values

Posted: Thu Jul 07, 2011 2:59 am
by eswar1
Hi,
In my project my requirement is merge the duplicate values into one.
My source is like this:
key,col1,col2,col3,col4
01, a, null, null, null
01, null, b, null, null
01, null, null, c, null
01, null, null, null, d
02, p, null, null, null
02, null, q, null ,null
02, null ,null ,r, null
02, z, null ,null ,s

But I wants my target is like this:
key,col1,col2,col3,col4
01,a,b,c,d
02,z,q,r,s

based on key column we can merge the column values.
Please help me to achieve this logic.
I'm struggling to get this output.

Thanks,

Posted: Thu Jul 07, 2011 7:02 am
by chulett
Seems to me the Aggregator would work for this, group on the first column and take the max of all the others.

Posted: Thu Jul 07, 2011 10:29 am
by jwiles
As an option to Aggregator, in pre IS8.5, you can use a combination of transformer and remove duplicates stages. In 8.5, you can take advantage of the transformer's looping functionality.

Regards,

Posted: Tue Jul 12, 2011 5:28 am
by eswar1
I used aggregate stage but it's not given required output.

Posted: Tue Jul 12, 2011 6:32 am
by chulett
You'll need to do better than that if you want more help. What exactly did you do in the Aggregator and what output are your getting?