To Get Maximum 3 values in Datastage

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
Shruthi
Participant
Posts: 74
Joined: Sun Oct 05, 2008 10:59 pm
Location: Bangalore

To Get Maximum 3 values in Datastage

Post by Shruthi »

Hi,

I have a table like this
E.No Salary
1 1000
2 2000
3 5000
4 4000
5 1200

I want top three employee numbers who have maximum salary. How can this be acheived?

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

Post by ray.wurlod »

Sort them and run them through a Head or Tail stage. Run in sequential mode (or perhaps on three nodes, but this is not guaranteed to be accurate). You don't need an Aggregator stage - there is no solution involving an Aggregator stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Shruthi
Participant
Posts: 74
Joined: Sun Oct 05, 2008 10:59 pm
Location: Bangalore

Post by Shruthi »

Thanks... This really helps
Post Reply