Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Here are the screenshots
General View
My source data
Source Schema
tSortRow config
tMap config with sequence
Final Results
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.
Can u please attach some screenshots for clear understanding . Thanks in Advance
Here are the screenshots
General View
My source data
Source Schema
tSortRow config
tMap config with sequence
Final Results
Thank you very much
Using tMap component we can get the Top 5th highest record. If you follow below steps in tMap component we will get only top 5th highest record. In this example I am taking top 5th salary paid from the employees.
Step-01: Below is the Job Flow, Using tSortRow and tMap components.
Step-02: In the tSortRow component sort the data as mentioned below.
Step-03: In the tMap component, create the variables like
SeqID = Numeric.sequence("SID",1,1) and in the Expression filter give the condition as Var.SeqID == 5.
Steo-04: Now run the job and see the output in the tLogRow component. We will only one record, which is top 5th salary from employees.
Using tMap component we can get the Top 5th highest record. If you follow below steps in tMap component we will get only top 5th highest record. In this example I am taking top 5th salary paid from the employees.
Step-01: Below is the Job Flow, Using tSortRow and tMap components.
Step-02: In the tSortRow component sort the data as mentioned below.
Step-03: In the tMap component, create the variables like
SeqID = Numeric.sequence("SID",1,1) and in the Expression filter give the condition as Var.SeqID == 5.
Steo-04: Now run the job and see the output in the tLogRow component. We will only one record, which is top 5th salary from employees.