PIVOT Stage

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
aluthra48
Participant
Posts: 66
Joined: Thu Mar 05, 2009 9:59 am

PIVOT Stage

Post by aluthra48 »

Can someone help me in configuring the Pivot Stage? The input data coming in is

A, B, C, D

and I need the output to be:

A, B, C1, C2, D1, D2

Example:
Input:

12345 aaaa c1 d1
12345 aaaa c2 d2

Output:
12345 aaaa c1 c2 d1 d2

Thank you
nagarjuna
Premium Member
Premium Member
Posts: 533
Joined: Fri Jun 27, 2008 9:11 pm
Location: Chicago

Post by nagarjuna »

Is it a pivot or join ?? :?
Nag
aluthra48
Participant
Posts: 66
Joined: Thu Mar 05, 2009 9:59 am

Post by aluthra48 »

PIVOT

Thanks
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

I think the obvious solution is using stage variables in a transformer, but, in case the number of reoccurances is varying you might need to build a routine that concatenates the fields
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
aluthra48
Participant
Posts: 66
Joined: Thu Mar 05, 2009 9:59 am

Post by aluthra48 »

I can use the 1st occurence for C1 and the last for C2. Ditto for D.
Can you explain how to use the stage variables in a transformer to accomplish this?
Thanks
aluthra48
Participant
Posts: 66
Joined: Thu Mar 05, 2009 9:59 am

Post by aluthra48 »

Used T-SQL to create the pivot
Post Reply