Mapping table in QlikView is a table, which is created to map the column values between two tables. It is also called a Lookup table, which is only used to look for a related value from some other table. With Joining two table you can refer data of one table in another table.

By using mapping table, you can map the values of a particular column of a table with values of columns of another table.

Please take a look at the following example. First, you need a mapping table, then you use the MAP sentence, and from then, all values in CountryCode will be changed for the matching in the mapping table. In the example, ES and US will be changed to “Spain” and “United States”, while UK will stay (there’s no match in the mapping table for that value).

Syntax:

MappingTable1: 
Mapping LOAD * INLINE [ 
CountryCode, CountryName 
ES, Spain 
US, United States
IN, India 
PK, Pakistan
]; 


MAP OriginalTable USING MappingTable1;

OriginalTable:
LOAD *,
ApplyMap(‘MappingTable1′,CountryCode,’NA’) as CountryName
INLINE [
CountryCode
ES
UK
US
IN
PK
CH
];

Output:

This how the table looks like after data mapped with the mapping table.

On the above screenshot, UK and CH are two country codes whose reference is not found in the Mapping Table, that’s why it is showing “NA” in the Country Name column.


Cheers..
Prince Tech Solutions
M: +91-9583261771 | 7008692828

[email protected] | www.princetechsolutions.com
—————————————————————————————-
Delivering High Earning Skill Sets
Online Training | Corporate Training | Consulting | Job Support