How to get fifth highest value from a column

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.


Accepted Solutions
Five Stars

Re: How to get fifth highest value from a column

Here are the screenshots

0.jpgGeneral View1.jpgMy source data2.jpgSource Schema3.jpgtSortRow config4.jpgtMap config with sequence5.jpgFinal Results


All 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

0.jpgGeneral View1.jpgMy source data2.jpgSource Schema3.jpgtSortRow config4.jpgtMap config with sequence5.jpgFinal Results

Five Stars

Re: How to get fifth highest value from a column

Thank you very much

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.