count record based on key field without droping nonkey field

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
singhald
Participant
Posts: 180
Joined: Tue Aug 23, 2005 2:50 am
Location: Bangalore
Contact:

count record based on key field without droping nonkey field

Post by singhald »

Hi

I need to count source records using key fields and attched this count to all record in output.

I want to keep all source records and fields in target with record count based on key field.

Exmple:
Source data
Key Col2 Col3
1 A X
1 B Y
2 C Z
3 D S
3 D Y

output

Key Col2 Col3 Count
1 A X 2
1 B Y 2
2 C Z 1
3 D S 2
3 D Y 2



right now i am doing this by using copy stage, aggregator and join stage.

do we have any best solution to achive this logic.

Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Does your "fork join" design work? If so, that's the design to use.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
singhald
Participant
Posts: 180
Joined: Tue Aug 23, 2005 2:50 am
Location: Bangalore
Contact:

Post by singhald »

Thanks Ray,

fork join design is working. i just wanted to know, is this design optmized to achive the outcome ?
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What alternative is there?

If your answer to that question is "none", then my answer to your question is "yes".
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