Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Need help.
I got a Tables as below and need to map country across.
Table 1:
Code Name
-------------------------
US United States
CH China
I need to compare the above fields to the below table to generate a new column 'Presence' - the final table will be as below
Table 2:
ID Country Sales Presence
---------------------------------------------------
MX Mexico 50000 No
US United States 60000 Yes
IN India 40000 No
Could you please advise how to go with the same? Please understand this is a sample and I may need to scale the same to more rows.
Thank you
@ksasidhars Please follow the below script to get the desired results.
NoConcatenate
Temp:
Load * Inline [
Code,Name
US,United States
CH,China
];
Right join (Temp)
Load ID as Code,
Country,
Sales
Inline [
ID,Country ,Sales
MX,Mexico,50000
US,United States,60000
IN,India,40000
];
Main:
Load *,
if(isnull(Name),'No','Yes') as Presence
Resident Temp;
Drop table Temp;
Exit Script;
If this resolves your issue,kindly like and accept it as a solution.
@ksasidhars Please follow the below script to get the desired results.
NoConcatenate
Temp:
Load * Inline [
Code,Name
US,United States
CH,China
];
Right join (Temp)
Load ID as Code,
Country,
Sales
Inline [
ID,Country ,Sales
MX,Mexico,50000
US,United States,60000
IN,India,40000
];
Main:
Load *,
if(isnull(Name),'No','Yes') as Presence
Resident Temp;
Drop table Temp;
Exit Script;
If this resolves your issue,kindly like and accept it as a solution.
Thank you Sidhiq.
I yet to try my actual requirement as we have a mix of Country code and names in the actual table - so join may not work - your solution is correct for the ask.