to find the min value

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
uppalapati2003
Participant
Posts: 70
Joined: Thu Nov 09, 2006 2:14 am

to find the min value

Post by uppalapati2003 »

Hi all,

i have a reqeriment like this
let say i have 2 columns no1 is the surrogate key column

no1 no2

1 5
1 2
1 8
2 8
2 5
2 6

i want find the min value of the particular surrogate key

i know to do in the remove duplicates stage and sort
but i want to know how to find in the transformer it self

please if anyone knows give me reply
that was very helpful to me

Thanks
Srini
MOHAMMAD.ISSAQ
Participant
Posts: 78
Joined: Fri Mar 02, 2007 4:54 am
Location: CHENNAI

Post by MOHAMMAD.ISSAQ »

First you can sort the columns in ASC giving priority to 1st col and then 2nd.

After sorting consider your target file as Hash lookup.
Output.Col1=AfterSort.Row_Id
Output.Col2=VarRowTemp

Where VarRowTemp is :-
"If VarRowPrev <> VarRowCurr Then AfterSort.Row_Val Else "N""

VarRowPrev = VarRowCurr

VarRowCurr = AfterSort.Row_Id

Note: In hash lookup put constraint as "VarRowTemp <> "N" "
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The appropriate stage type is Aggregator.
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