Tuesday, 25 March 2014

How to segregate the Duplicate and Distinct rows from source table to separate target tables?

Source Table:
Col 1Col 2Col 3
ABC
LMN
ABC
OPQ
OPQ
XYZ

Target Table 1 (Duplicate Records): 
Col 1Col 2Col 3
ABC
OPQ

Target Table 2 (Distinct Records):
Col 1Col 2Col 3
LMN
XYZ

Solution: 
Step  1: Drag  the source to mapping and connect it to an aggregator transformation.
Step  2: In aggregator transformation, group by the key column and add a new port  call it count_rec to count  the key column.
Step  3: Connect  a router to the  aggregator from the previous step. In router make two groups one named "Distinct" and another as "Duplicate"
In Distint write count_rec=1 and in Duplicate write count_rec>1.















The picture below depicting group name and the filter conditions





















Step 4: Connect two groups to corresponding target table.



















Ur's Hari
If you like this post, please share it by clicking on g+1 Button.


No comments:

Post a Comment