informaticainformatica-powercenter

I want to Assign 'Y' to the Duplicate Records and 'N' to the Unque Records, And Display those 'Y' and 'N' Flags in 'Duplicate' Column


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

Source Table:

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

Solution

  • You need to calculate count grouping by key columns using aggregator. And then join back to original flow based on key columns.

    1. use Sorter sort the data based on key columns like name and country in your example.
    2. use Aggregator to calculate count() group by key columns.
    out_count= count(*)
    in_out - key_column
    
    1. use 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.
    2. use 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