How to find max sal using remove duplicate stage

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
nravikrishna
Participant
Posts: 6
Joined: Mon Mar 26, 2012 12:49 am
Location: hyderabad

How to find max sal using remove duplicate stage

Post by nravikrishna »

hi frds i have one question how to find max sal using remove duplicate stage
i have data like

deptno,sal
10,1300
20,1100
30,1200
20,1200
10,1000
30,1600
30,1500

Ans:
10,1300
20,1200
30,1600

please send me to personal email mail2 <removed>
Ravikrishna
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Several things need to be said here before your question gets answered.

1. Welcome.
2. When you have a question, start a new post. Please don't just reply to whatever post you happen to be reading at the time.
3. I split yours out to the above noted post of your own.
4. Because of that, I had to guess OS and Version. Fix those if they are wrong.
5. Answers do not get sent to personal email, they go here. You can get notifications of a reply via email, however.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sort in the proper order and then keep first or last, depending on said order. Hash partition if running on multiple nodes. Of course, you could also use an Aggregator but that wasn't the question. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: How to find max sal using remove duplicate stage

Post by ray.wurlod »

nravikrishna wrote:to find max sal using remove duplicate stage
That's like asking how to join water pipes using a screwdriver. What ever happened to "the right tool for the right job"? Why using this particular stage type, whose function - I should not have to say - is NOT about finding maximum values.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
lannguyen
Participant
Posts: 3
Joined: Wed Mar 21, 2012 3:55 am

Re: How to find max sal using remove duplicate stage

Post by lannguyen »

Remove duplicate :
- key = deptno.
- In the Partition tag: choose Hash on deptno and sort (desc) on sal
Post Reply