Databases Reference
In-Depth Information
Comment
FROM
[..\Data Files\Excel\Comments.xls]
(biff, embedded labels, table is Fields$);
COMMENT TABLES USING Map_Table_Comments;
COMMENT FIELDS USING Map_Field_Comments;
We have now created two mapping tables and have instructed QlikView to use these
tables to assign comments to the tables and fields, using the
COMMENT TABLES
and
COMMENT FIELDS
statements.
When we save and reload our document and open
Table Viewer
by pressing
Ctrl
+
T
, we should see the comments that we loaded when hovering over the fields of the
Aircraft Types
table.
Storing tables
Now that we have built our Aircraft Type dimension table, we can use it in our
QlikView document. In an environment with multiple documents, it is very likely
that we will want to re-use the same table in different apps. Fortunately, there is an
easy way to export a QlikView table to an external QVD file; the
STORE
statement.
We can store the
Aircraft Types
table to a QVD file by adding the following piece of
code at the end of our script:
STORE [Aircraft Types] INTO '..\Data Files\QVDs\
AircraftTypesTransformed.qvd' (qvd);
This tells QlikView to store the table
[Aircraft Types]
into the sub-folder
DataFiles\QVDs
with the filename
AircraftTypes.qvd
. The
.qvd
suffix at the end
of the statement tells QlikView to use the QVD format. The other option is
(txt)
to
store the table in text format.
Renaming tables and fields
Renaming tables or fields in QlikView is done using the
RENAME
statement. The
following code shows some examples of this statement:
RENAME TABLE [Aircraft Types] TO [Aircraft];
RENAME FIELD [%Aircraft Type ID] TO [Aircraft ID];
RENAME FIELD [Aircraft Begin Date] to [Begin], [Aircraft End Date] to
[End];