Page 1 of 1

Rows to column

Posted: Tue Mar 11, 2008 4:20 am
by shaonli
My i/p is
Loc name address
100 a1 abc
100 a2 abcd
200 b1 abcds
200 c1 abcdsa
200 a1 abc
300 a1 abc

O/p
Loc name1 name2 name3 address1 address2 address3
100 a1 a2 null abc abcd null
200 b1 c1 a1 abcds abcdsa abc
300 a1 null null abc null null

Please suggest which stage to use for converting rows into columns

Re: Rows to column

Posted: Tue Mar 11, 2008 4:51 am
by siva7143
For the above scenario Pivot stage can be used to convert the rows into columns.Use the Derivation field in the output link column grid to specify the pivots.

Posted: Tue Mar 11, 2008 5:49 am
by ray.wurlod
Pivot stage goes from rows to columns (horizontal pivot), not columns to rows (vertical pivot). Search the forum for "vertical pivot" to learn various techniques.

It has been suggested (at IOD 2007) that vertical pivot will be possible in the Pivot stage in version 8.1 (later this year).

Posted: Tue Mar 11, 2008 9:15 am
by mansoor_nb
You can use the combined record stage or you have to write a logic in the transformer to convert rows into columns.