Record by record comparison

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
dnat
Participant
Posts: 200
Joined: Thu Sep 06, 2007 2:06 am

Record by record comparison

Post by dnat »

Hi

I have some data like this

KeyID, Data1,Data2
1,test1,test2
1,mmm,nnn
2,ttt,bbb
2,444,888
1,vvv,bbb
1,sss,fff

And I want the data like this

KeyID,Data1,Data2,Data3,Data4
1,test1,test2,mmm,nnn
2,ttt,bbb,444,888
1,vvv,bbb,sss,fff

So, when there is a key, I would like to take all corresponding data from the next line. How could I possibly do that.

Looping or transformer stg variable? or any other ides?

Thanks!!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes, either one. And technically it is a form of a vertical pivot of rows to columns so that could be yet another option for you.
-craig

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