how to get minimum value without using aggregator 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
skyboyfli
Participant
Posts: 32
Joined: Fri Jun 04, 2010 8:21 am
Location: hyd
Contact:

how to get minimum value without using aggregator stage

Post by skyboyfli »

I hve the data like this

Deptno sal
-------- -------
10 3000
10 234000
10 3434
20 3547
30 4544
40 4656
40 3434
20 5767

I neet to get deptno with minimum sal ..... but without using aggregator!

Thanks in advance.
this is nice
sureshbabu
Participant
Posts: 11
Joined: Fri May 29, 2009 9:54 pm
Location: hyd

Re: how to get min sal without using aggregator stage

Post by sureshbabu »

friest filer basend on depno, then sort ase order on sal then the both depno and sal and using copy pass only one
swathi Singamareddygari
Participant
Posts: 48
Joined: Fri Feb 29, 2008 1:09 am
Location: Bangalore

Post by swathi Singamareddygari »

Hi,

1)First sort the data based on Deptno and Sal in ascending order by using sort stage
2)After that use the remove duplicate stage and set Duplicates to retain to First
Thanks&Regards
S.Swathi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: how to get min sal without using aggregator stage

Post by ray.wurlod »

sureshbabu wrote:friest filer basend on depno, then sort ase order on sal then the both depno and sal and using copy pass only one
Please replace your keyboard with one that can spell!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Re: how to get min sal without using aggregator stage

Post by stuartjvnorton »

skyboyfli wrote:I hve the data like this

Deptno sal
-------- -------
10 3000
10 234000
10 3434
20 3547
30 4544
40 4656
40 3434
20 5767

I neet to get deptno wise min sal ..... but without using aggregator!

Thanks in advance.

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

Post by ray.wurlod »

Job interview leading to min sal ?
:wink:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
skyboyfli
Participant
Posts: 32
Joined: Fri Jun 04, 2010 8:21 am
Location: hyd
Contact:

Post by skyboyfli »

swathi Singamareddygari wrote:Hi,

1)First sort the data based on Deptno and Sal in ascending order by using sort stage
2)After that use the remove duplicate stage and set Duplicates to retain to First
im having 6 nodes system..
so sorting of two columns not giving expected results...

how to do this in multinode system
this is nice
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you get incorrect values with multiple nodes then you have partitioned incorrectly. You need to partition on DEPTNO.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

ArndW wrote:If you get incorrect values with multiple nodes then you have partitioned incorrectly. You need to partition on DEPTNO.
... using a key-based partitioning algorithm, for example Modulus or Hash.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
skyboyfli
Participant
Posts: 32
Joined: Fri Jun 04, 2010 8:21 am
Location: hyd
Contact:

done

Post by skyboyfli »

swathi Singamareddygari wrote:Hi,

1)First sort the data based on Deptno and Sal in ascending order by using sort stage
2)After that use the remove duplicate stage and set Duplicates to retain to First
i made the sort stage in sequential mode....
and i got expected data

Thanks
this is nice
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

That may work, but it isn't technically the best way to write your job. If you want to be a good PX developer, you need to learn how partitioning works. Turning it off because you don't understand it just makes for slow jobs.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
Post Reply