Need to assign key

Highlighted
Six Stars

Need to assign key

Hello All,

 

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.

 

1.PNG

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.

 

Please help me of how to achieve this. Thank You

 

This is how my job is.


3.PNG

Six Stars

Re: Need to assign key

I thought my earlier post might not a bit clear and hence I created a sample job and below is how Im trying to get the output.

Capture.PNG

 

Below is how im expecting my out put to be.

Capture.PNG

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog