Page 1 of 1

convert rows in to column

Posted: Thu Mar 24, 2011 1:38 am
by synsog
How to convert rows in to column in 7x Parallel

Please help me

- Rams

Re: convert rows in to column

Posted: Thu Mar 24, 2011 3:50 am
by ds@tcs
use pivot stage

import the source data,
give the target column names, then what ever the columns want to make rows,, map those columns to under required trg col
the data bill be added in row format

Posted: Thu Mar 24, 2011 11:55 pm
by synsog
it will not possible in pivot stage, we need to convert rows in to column

Posted: Fri Mar 25, 2011 1:14 am
by ray.wurlod
It is possible. This is precisely what the Pivot stage does.

Posted: Fri Mar 25, 2011 1:35 am
by synsog
Hi Ray,

thanks for you reply

Following is my requirement.

Source
=====

Col
===
1
2
3
4

target
=====

Col
===
1,2,3,4


source records count will vary, it will not same always.


thanks,
Rams

Posted: Fri Mar 25, 2011 2:35 am
by ds@tcs
Hey Man it is possible with pivot stage..
i worked on that..
u try with the logic above what i mentioned ,
how many columns there maybe no problem it will convert..
you try and then tell me

Posted: Fri Mar 25, 2011 2:49 am
by priyadharsini
are you doing this based on any key olumn?

Posted: Fri Mar 25, 2011 5:44 am
by priyadharsini
All the records in a column has to be combined into a single record using the stage variables in transformer.

1. Create a dummy key column, sort and partition on that column.
2. In transformer use stage variables, one will store the current record and the stage variable will append the records.
e.g.
Input Column = Stagevariable
Stagevariable:stagevariable1=stagevaribale1
3. Use Remove duplicate and retain the last record.