Generic Load is the complement of “Crosstable Load”. In a loose sense, you could say that aCrosstable Load creates a Generic table and Generic Load creates a Cross table.
Consider this table which contains a separate row for each Phase of a Project.
GENERIC LOAD Project, ‘End Phase ‘ & Phase, EndDate
Generic Load creates additional Qlikview tables. The additional tables cannot be avoided by combining a CONCATENATE or JOIN prefix. In the next example I’ll offer a technique to consolidate the tables.
Here’s another application of Generic. Consider this example table.
Suppose you want to generate flag fields for each of the possible order statuses? The flags could be created with a single Generic Load.
GENERIC LOAD Order, ‘Status_’ & Status, 1
The resulting data model now contains flags for each Order.
As mentioned previously, Generic Load creates additional tables. The table view after the above Generic Load is:
FOR i = NoOfTables()-1 to 0 STEP -1 LET vTable=TableName($(i)); IF WildMatch('$(vTable)', 'Flags.*') THEN LEFT JOIN (OrdersTable) LOAD * RESIDENT [$(vTable)]; DROP TABLE [$(vTable)]; ENDIF NEXT i
The qvw examples used in this post may be downloaded from here.