Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to map a Two tables?

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

9 Replies
Not applicable
Author

A:

LOAD

Country,

rowno() as key

from tableA;

B:

load Country as country_name ,

rowno() as key

from tableB;

Not applicable
Author

its not giving require out put

rphpacheco
Creator III
Creator III

How are coming your data?

Comes from the database?

It is in line?

Or a file?

Not applicable
Author

From first table from mysql db

second table from excel

Not applicable
Author

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

Not applicable
Author

iam getting  erro Country filed not found

Not applicable
Author

You have to use the name of the field as define in your excel file in the applymap statement

Not applicable
Author

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;

Not applicable
Author

hmm