Tuesday, 14 October 2014

Get top 5 records to target without using rank


Get top 5 records to target without using rank

 

SOLUTION:

SourceEMP Table
Target : EMP_BKP
* Same structure as off EMP.
Step 1: Drag the source to mapping and connect it to sorter transformation.
 











Step 2: Arrange the salary in descending order in sorter as follows and send the record to expression.
 















Step 3: Now create a Expression Transformation and connect it from sorter.Create a port as "NEXTVAL" with integer data type in Expression Transformation. Also Create a Sequence Transformation, start with 1 and connect nextval port to Expression's Nextval port shown below.

 






















Step 4: Connect the expression transformation to a filter or router. In the property set the condition as follows..
















Step 5: Finally Connect to Target.








No comments:

Post a Comment