Generic databases
A generic database is a table in which the field names are stored as field values in one column, while the field values are stored in a second. Generic databases are usually used for attributes of different objects.
Look at the example GenericTable below. It is a generic database containing two objects, a ball and a box. Obviously some of the attributes, like color and weight, are common to both the objects, while others, like diameter, height, length and width are not.
object | attribute | value |
---|---|---|
ball | color | red |
ball | diameter | 10 cm |
ball | weight | 100 g |
box | color | black |
box | height | 16 cm |
box | length | 20 cm |
box | weight | 500 g |
box | width | 10 cm |
On one hand it would be awkward to store the data in a way giving each attribute a column of its own, since many of the attributes are not relevant for a specific object.
On the other hand, it would look messy displaying it in a way that mixed lengths, colors and weights.
If this database is loaded into Qlik Sense using the standard way and display the data in a table it looks like this:
However, if the table is loaded as a generic database, column two and three will be split up into different tables, one for each unique value of the second column:
The syntax for doing this is simple:
Example:
Generic SELECT* from GenericTable;
It does not matter whether a LOAD or SELECT statement is used to load a generic database.
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!