Page 1 of 1

combing some columns have two identical rows

Posted: Fri Feb 15, 2008 2:58 am
by 4friends
hii can anyone plz help me out..

my input data is like this..

TXN_DATE RO_CODE REGION_DESC SV MS M C TK TB UV
10/12/2005 3 REGION 3 0 1 0 0 0 0 0
10/12/2005 3 REGION 3 0 0 0 0 0 1 0
10/12/2005 3 REGION 3 0 0 0 0 0 0 1
11/12/2005 3 REGION 3 0 0 0 0 0 0 1
11/12/2005 3 REGION 3 0 0 0 0 0 1 0


and the desired output is..

TXN_DATE RO_CODE REGION_DESC SV MS M C TK TB UV
10/12/2005 3 REGION 3 0 1 0 0 0 1 1
11/12/2005 3 REGION 3 0 0 0 0 0 1 1

can any one just tell me which logic to use to combine 1st 3 rows and get inot 1 like in ouput..

thxs
kk

Posted: Fri Feb 15, 2008 4:40 am
by ray.wurlod
Are you meant to add (for example what if one date had 1 in more than one row for the same column)? If not, what is the rule for combination?

The approach, nonetheless, is to build the rows in a Transformer stage, outputting only when processing the last record in each group (date). You can identify the last record in each group using Sort stages.