Ranking the data both from above and below

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
bapajju
Participant
Posts: 82
Joined: Wed Nov 19, 2003 11:58 pm

Ranking the data both from above and below

Post by bapajju »

Hi all,
I have to extract top 10 sales man (in terms of number of units they have sold) and bottom 10 sales man.The data is coming through a comma separated flat file. Can I get the top and bottom 10 sales man from this data file without putting the data into any temporary table???Please suggest.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If it's not already sorted, get it sorted; use a UNIX sort, the Sort stage, or the CoSORT plug-in (from the folks who host this site). Run the results through a Transformer stage, with an output link constraint such as @INROWNUM <= 10.
Similarly, sort in descending order to get the other end of the range.
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