How to remove duplicate records using Expression
In the last post we have used Aggregator Transformation to remove the duplicate records. In this post we will use the Expression transformation to remove the duplicate JOB_ID from the source Flat file.
Source – Flat File
Target – Oracle Table
Key port – JOB_ID
Transformations
Sorter – To sort the source records (To improve Aggregator Performance)
Expression – To compare the current and previous value and assign duplicate count
Filter – To Filter out the duplicate records
Here is the variable & output ports used in Expression.
V_COUNTER = IIF(V_PREV_JOB_ID=JOB_ID,V_COUNTER + 1)
O_COUNTER = V_COUNTER
V_PREV_JOB_ID = JOB_ID