aggregation rows/ summary 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
cyclogenisis
Premium Member
Premium Member
Posts: 48
Joined: Wed Jan 07, 2015 3:30 pm

aggregation rows/ summary rows

Post by cyclogenisis »

Have the following:

a,b,2
a,c,6
k,c,8
k,b,4

Need:

a,b,2
a,c,6
k,c,8
k,b,4
all,c,10
all,b,6
a,all,8
k,all,12
all,all,20

What is the easiest way to achieve this using parellel?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Begin by documenting the rules for producing the output. I don't understand, for example, where the 10 comes from in the fifth line of your output.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

I think you should have 14 on this line "all,c,10"

Input --> Transformer ---> Aggregator --> Seq

Have three output links to transformer.

In first output link, have this mapping
Field1 --> Field1
'All' --> Field2
Field3 --> Field3

In second output link, have this mapping
'All' --> Field1
Field2 --> Field2
Field3 --> Field3

In third output link, have this mapping
'All' --> Field1
'All' --> Field2
Field3 --> Field3

In aggregator, use Field1 and Field2 as key and sum Field3
You are the creator of your destiny - Swami Vivekananda
Post Reply