Databases Reference
In-Depth Information
The following is an example of a generic table:
Object
Attribute
Value
Ball
Color
Yellow
Ball
Weight
120 g
Ball
Diameter
8 cm
Coin
Color
Gold
Coin
Value
$100
Coin
Diameter
2.5 cm
Hockey Puck
Color
Black
Hockey Puck
Diameter
7.62 cm
Hockey Puck
Thickness
2.5 cm
Hockey Puck
Weight
165 g
As you can see, there are several different attributes (color, diameter, weight, and
so on) and only a few of them are shared among all objects. Some attributes, such
as thickness, are only used for a single object.
Using the preceding structure, the table is kept from growing too large in terms of
columns, regardless of new objects or attributes being added.
Using a traditional structure, the preceding table would have several columns
(one for each attribute), and each time a new attribute is added, a new column
should be added as well. Additionally, attributes (columns) that are not applicable
for certain objects (rows), would have a corresponding null or blank value.
Loading a generic table into QlikView
When loading a generic table, we can use the
GENERIC
keyword so QlikView treats
the table as such and converts its structure in a way that is more appropriate for the
associative data model and is easier for user interaction.
Let's load this table into a new QlikView document using the
GENERIC
keyword:
1. Start by creating a new QlikView document and name it
Generic Load.qvw
.
2. Store the QVW file into the
Airline Operations\Side Examples\
Chapter 9
folder.
3.
Make sure the
Generic DB.xls
file is also at the same location.
4.
Open the script editor and bring up the
File Wizard
dialog with the
associated example file.