How to get 2nd Highest Salary in Abinitio | get nth highest salary
Watch my YouTube video for explanation :
How to get 2nd Highest Salary in Abinitio | get nth highest salary | group processing in abinitio
Please look into the class notes here for your references:
how to get 2nd highest value in group by customer id?
I/P -> SORT within Group {Customer id and minor-key Amount desc)->
-> SCAN and create one more field as sequence id(output-select)->O/P
INPUT ==> SORT ==> SCAN (Key=Customer id) ==> Output
type temporary_type=
begin
decimal("") sequnce_id;
end;
temp::initialize(in)=
begin
temp.sequnce_id::0;
end;
out::scan(temp,in)=
begin
out.sequnce_id::temp.sequnce_id +1;
end;
out::finalize(temp,in)=
begin
out.*::in.*;
out.sequnce_id::temp.sequnce_id;
end;
sequence_id
1 - for the max trasaction value
2 - 2nd highest
3 -
4 -
out::output_select(in)=
begin
out.*::if(in.sequnce_id==2)in.*;
end;
Fore more Abinitio, AWS and data engineering videos please subscribe , view , like and share my YouTube channel
Click DataPundit
Comments
Post a Comment