I have a requirement where a column has to values in my source table, for example USA,CANADA and I have split those two records and passing them as two different rows to the target table.
For Example in the below Image, the ones which are highlighted in yellow are as United States, Canada in the source which I split in to two different rows.
Now my requirement is to Assign 1 for United States and 0 for Canada in PRIMARY_INDICATOR_COLUMN. The idea is when there are two countries with same CITIZENSHIP_GROUP_KEY, then we need to assign 1 for the first one and 2 for the second one. If there is only one country per CITIZENSHIP_GROUP_KEY, then PRIMARY_INDICATOR should always be 1.