Page 1 of 1

how to Convert row data to columns

Posted: Mon Feb 20, 2012 10:06 am
by vishu19aug
Hi,

I have the following input -

Table_name attribute value
table_000 field1 1200
table_000 field2 1300
table_000 field3 as
table_001 field1 0
table_001 field2 1100
table_001 field3 ad

I want the data in the follwong format -

table_000 field1 1200 field2 1300 field3 as
table_001 field1 0 field2 1100 field3 ad

Can somebody help here? I am new to datastage.

Thanks,
Vishal

Posted: Mon Feb 20, 2012 10:34 am
by chulett
Rows to columns is also known as a 'vertical pivot', something you could do an exact search for here to get all kinds of help. Which also means you should look at the Pivot stage but the capabilities there depend on your exact 8.x version.

Posted: Mon Feb 20, 2012 10:59 am
by vishu19aug
Thanks! I can see only Pivot and Pivot Enterprise in version 8.7

Posted: Mon Feb 20, 2012 11:05 am
by chulett
Only? How many more do you need? :wink:

Inside them would be an option to drive the 'direction' of the pivot.

Posted: Mon Feb 20, 2012 9:04 pm
by kandyshandy
2 more Craig :lol:

Posted: Tue Feb 21, 2012 11:22 am
by vishu19aug
Thanks! it solved my problem