Databases Reference
In-Depth Information
By prefixing the
LOAD
statement with the
MAPPING
statement, we tell QlikView
that we want to create a mapping table. This is a specific type of table that has the
following properties:
• It can only have two columns, the first being the lookup value and the second
being the mapping value to return.
• It is a temporary table. At the end of the script, QlikView automatically
removes the table from the data model.
We then used the
ApplyMap()
function to look up the aircraft manufacturer's
country while loading the
Aircraft_Base_File.csv
and
Aircraft_2010_Update.
csv
files. The
ApplyMap()
function uses three parameters:
• The name of the mapping table to use, in our case this is the
Map_
Manufacturer_Country
table
• The search value, a field value or expression from the source table, that is
looked up in the mapping table. We used the
MANUFACTURER
ield
• An optional value that specifies what value to use when no match is found
in the mapping table; here we used the value
Unknown
. When no value is
specified, the search value is returned.
You may wonder why we are using the name
MANUFACTURER
in the
ApplyMap()
function, and not the
name
[Aircraft Manufacturer]
that we renamed it to.
This is because renamed fields only become known by the
name after the entire
LOAD
statement has been executed.
Let's look at how this affects the data model:
1.
Save
and
reload
the document.
2. After reload is finished, remove the fields
AC_GROUPNAME
and
Aircraft
Begin Date
from the Aircraft multibox.
3.
Add the
Aircraft Manufacturer
and
Aircraft Manufacturer Country
fields to the
Aircraft
multibox.
4.
Select the value
Unknown
from the
Aircraft Manufacturer Country
list-box.