Five Stars

How to get fifth highest value from a column

A source table contains emp_name and salary columns.

I want to have a mapping to load all records with 5th highest salary into the target table.

1 ACCEPTED SOLUTION

Accepted Solutions
Five Stars

Re: How to get fifth highest value from a column

Here are the screenshots

General ViewGeneral ViewMy source dataMy source dataSource SchemaSource SchematSortRow configtSortRow configtMap config with sequencetMap config with sequenceFinal ResultsFinal Results

4 REPLIES
Five Stars

Re: How to get fifth highest value from a column

The best option is making from the source, if your source is oracle you could make a query that returns you the 5 rows you need.

 

Also you could use a tSortRow component sorting column salary in desc order, then a tmap component where you declare a var with numeric sequence (using the internal talend function) from  value1 and increment by 1, and an output with a condition where you evaluates this variable and if its value is between 1 and 5 then the output is valid.

Five Stars

Re: How to get fifth highest value from a column

Can u please attach some screenshots for clear understanding . Thanks in Advance

Five Stars

Re: How to get fifth highest value from a column

Here are the screenshots

General ViewGeneral ViewMy source dataMy source dataSource SchemaSource SchematSortRow configtSortRow configtMap config with sequencetMap config with sequenceFinal ResultsFinal Results

Five Stars

Re: How to get fifth highest value from a column

Thank you very much