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

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog