Databases Reference
In-Depth Information
Manipulating tables
Now that we have seen an example of how QlikView script statements and functions
can be used to load and combine data, let's look at some of the most common script
statements for manipulating tables.
As we saw in earlier chapters, the
LOAD
statement is the main statement used to load
data into QlikView.
The script we created in this chapter showed us two statements that can be used to
combine data from different tables:
JOIN
and
CONCATENATE
. We will now look at
these statements and others in some more detail.
The JOIN statement
The
JOIN
statement is a prefix to the
LOAD
statement. It is used to join the table
that is being loaded to a previously loaded table. The two tables are joined using a
natural join
, this means that the columns in both tables are compared and the join
is made over those columns that have the same column names. This means that if
multiple columns are shared between tables, the match will be made over the distinct
combinations of those columns.
By default, QlikView performs an
outer join
. This means that the rows for both
tables are included in the resulting table. When rows do not have a corresponding
row in the other table, the missing columns are assigned null values.
Let us consider the following two tables: