Page 1 of 1

to find the min value

Posted: Mon Feb 04, 2008 7:10 am
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

Posted: Mon Feb 04, 2008 8:38 am
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" "

Posted: Mon Feb 04, 2008 5:02 pm
by ray.wurlod
The appropriate stage type is Aggregator.