Page 1 of 1

design question

Posted: Wed Sep 21, 2011 6:09 pm
by harryhome
Getting input as

Name Addresslineno Address
ABC 1 xyz
ABC 2 bhc
ABC 3 320
DFG 1 frfd
DFG 2 fgfg


Output required is
Name Address1 address2 address3
ABC xyz bhc 320
DFG frfd fgfg

please drop a note to inplemet this logic, if in sql also will do

Re: design question

Posted: Wed Sep 21, 2011 6:12 pm
by SURA
Refer Pivot stage

DS User

Re: design question

Posted: Wed Sep 21, 2011 6:15 pm
by harryhome
Thanks, what should be the derication in output column tab?
addrcolumn where address no = 1?

Posted: Wed Sep 21, 2011 6:31 pm
by ray.wurlod
What you are seeking to achieve is called a "vertical pivot". Search DSXchange for examples.

You need version 8.5 to accomplish a vertical pivot using a PXPivot stage.

Posted: Wed Sep 21, 2011 6:37 pm
by harryhome
thanks now I am trying to vertical pivot.

My question is when I have addr1 addr2 and addr3 in my target. and source is having addrtxt and addrno. how to configure stage vertical pivot to populate field addr1 in target when addrno is 1 in source?

Posted: Wed Sep 21, 2011 6:44 pm
by ray.wurlod
That is totally the opposite to the requirement you descrived originally. Please confirm what your requirement actually is.

Posted: Wed Sep 21, 2011 6:52 pm
by harryhome
Srry in case of confusion.

In example mentioned earlier

Name Addresslineno Address
ABC 1 xyz
ABC 2 bhc
ABC 3 320
DFG 1 frfd
DFG 2 fgfg


Output required is
Name Address1 address2 address3
ABC xyz bhc 320
DFG frfd fgfg




So in input i have addrs and addresslineno so in vertical pivot how so map these input columns to address1 , address2 and address3 columns?