I want to Assign 'Y' to the Duplicate Records and 'N' to the Unique Records, And Display those 'Y' and 'N' Flags in 'Duplicate' Column. Like Below
Name,Location
Vivek,India
Vivek,UK
Vivek,India
Vivek,USA
Vivek,Japan
Target Table:
=============
Name,Location,Duplicate
Vivek,India,Y
Vivek,India,Y
Vivek,Japan,N
Vivek,UK,N
Vivek,USA,N
How to Create a Mapping in Informatica Powercenter?
Which Logic I Should use?
[See the Image for More Clarification][1]
[1]: https://i.sstatic.net/2F20A.png
You need to calculate count grouping by key columns using aggregator. And then join back to original flow based on key columns.
Sorter
sort the data based on key columns like name and country in your example.Aggregator
to calculate count() group by key columns.out_count= count(*)
in_out - key_column
Joiner
to join aggregator data and sorter data based on key columns. Drag out_count and key columns from aggregator to joiner. Drag all columns from sorter. Do a inner join on key columns.Expression
and create an out expression. Use out_count column to calculate your duplicate flag.out_Duplicate = iif( out_count>1, 'Y','N')
Whole map should look like this
SRC -->SRT ---->AGG-->\
|------------->JNR-->EXP-->TGT