pivoting

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
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

pivoting

Post by dodda »

Hello

I have a requirement as below

Column1 Column2
01-2009 +212.08
02-2009 +313.05
03-2009 -212.04
04-2009 +112.06
05-2009 -117.23


and my out put should be like
If column1 starts with 01on source side then i need to populate the data of column2 from source to Col1 on targtet and the reaminig fields on the target should be empty

Col1 Col2 col3 col4 col5
+212.08
If column1 starts with 02 on source side then i need to populate the data of column2 from source to Col2 on targtet and the reaminig fields on the target should be empty

Col1 Col2 col3 col4 col5
+313.05


Please help me out to acheve this
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Output column derivations are all of the form

Code: Select all

If InLink.Col1 = value Then value Else SetNull()
I'm assuming that the output columns are decimal, not string, so that "empty" would not be a vaild value, hence my use of SetNull().
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What I was thinking was along the lines of:

Code: Select all

If Left(InLink.Col1,2) = '01' Then InLink.Col2 Else SetNull()
Where "Col1" and "01" change appropriately for each field to match their number.
-craig

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