combing some columns have two identical rows

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
4friends
Participant
Posts: 71
Joined: Tue May 01, 2007 12:51 pm
Location: Mumbai

combing some columns have two identical rows

Post 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
thanks & regards
kk
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply