Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi team
I Have two tables
A, B tables
A:
Country
Usa
India
lao
B:
Country
United state of america
India(alternate)
lao
Now how to map B Table with A table
Require out put:
Country
Usa
India
lao
A:
LOAD
Country,
rowno() as key
from tableA;
B:
load Country as country_name ,
rowno() as key
from tableB;
its not giving require out put
How are coming your data?
Comes from the database?
It is in line?
Or a file?
From first table from mysql db
second table from excel
Hi,
You can create a mapping table :
Map_Country:
MAPPING LOAD * INLINE [
Country_name, Country
'United state of america', 'Usa'
'India(alternate)', 'India'
'lao', 'Iao' ];
Then when you load your table B (from Excel), use this formula to load the country :
ApplyMap('Map_Country', Country) as Country
iam getting erro Country filed not found
You have to use the name of the field as define in your excel file in the applymap statement
try this , here i'm providing two concepts of mapping--
table1:
load * from table1;
table2:
load * from table2;
Map1:
MAPPING LOAD Country,
CountryName
Resident table1;
Mappedtable:
Load Country, ApplyMap('Map1', Country) as CountryName
resident table2;
**********************************************************************************
You can also mapped according to this code.
load * from table1;
load * from table2;
CountryMapName:
Mapping load County, countryName
Resident table1;
Map Country USING CountryMapName;
Data:
load Country
resident table2;
hmm