Page 1 of 1

how to handle the below reuirement

Posted: Tue Sep 30, 2008 8:12 am
by snt_ds
Hi I have a requirement like below. Can anyone help on this.

We have two columns like specified below.

Column A Column B
X1 10
X1 20
X2 22
X2 32
. .
. '
. .


We need output like specified below.

X1 10;20
X2 22;32
.
.
.


Could anypne please help me on this issue


Thanks in Advance

Posted: Tue Sep 30, 2008 9:04 am
by ArndW
Sort your data on Column A, then use stage variables and constraints in a transform stage along the following format:

Code: Select all

NewCol = IF(In.ColumnA=LastColumnA) THEN 1 ELSE 0
OutColumnA = IF NewCol=1 THEN LastColumnA ELSE ''
LastColumnA = In.ColumnA
OutList = IF NewCol=1 THEN ListString ELSE ''
ListString = IF NewCol=1 THEN '' ELSE ListString:';':In.ColumnB
Constraint is "NewCol = 1", the 2 output columns are derived from "OutColumnA" and "OutList".