Page 1 of 1

PIVOT Stage

Posted: Fri Jul 31, 2009 1:18 pm
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

Posted: Fri Jul 31, 2009 1:35 pm
by nagarjuna
Is it a pivot or join ?? :?

Posted: Fri Jul 31, 2009 1:46 pm
by aluthra48
PIVOT

Thanks

Posted: Fri Jul 31, 2009 2:02 pm
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

Posted: Fri Jul 31, 2009 3:54 pm
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

Posted: Fri Aug 21, 2009 3:43 pm
by aluthra48
Used T-SQL to create the pivot