merge duplicate values

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
eswar1
Participant
Posts: 10
Joined: Sat Jan 01, 2011 6:21 am

merge duplicate values

Post 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,
eswar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Seems to me the Aggregator would work for this, group on the first column and take the max of all the others.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post 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,
- james wiles


All generalizations are false, including this one - Mark Twain.
eswar1
Participant
Posts: 10
Joined: Sat Jan 01, 2011 6:21 am

Post by eswar1 »

I used aggregate stage but it's not given required output.
eswar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply