Script prefixes
Prefixes may be applied to applicable regular statements but never to control statements. The when and unless prefixes can, however, be used as suffixes to a few specific control statement clauses.
All script keywords can be typed with any combination of lower case and upper case characters. Field and variable names used in the statements are however case sensitive.
Use the drop-down on each function to see a brief description and the syntax of each function. Click the function name in the syntax description for further details.
The add prefix can be added to any LOAD, SELECT or map...using statement in the script. It is only relevant during partial reloads.
Add [only] (loadstatement | selectstatement | mapstatement)
QVD files can be created and maintained automatically via the buffer prefix. This prefix can be used on most LOAD and SELECT statements in script. It indicates that QVD files are used to cache/buffer the result of the statement.
Buffer[(option [ , option])] ( loadstatement | selectstatement )
option::= incremental | stale [after] amount [(days | hours)]
The Bundle prefix is used to include external files, such as image or sound files, or objects connected to a field value, to be stored in the QlikView file.
Bundle [Info] ( loadstatement | selectstatement)
If two tables that are to be concatenated have different sets of fields, concatenation of two tables can still be forced with the Concatenate prefix.
concatenate[ (tablename ) ] ( loadstatement | selectstatement )
The crosstable prefix is used to turn a cross table into a straight table, that is, a wide table with many columns is turned into a tall table, with the column headings being placed into a single attribute column.
crosstable (attribute field name, data field name [ , n ] ) ( loadstatement | selectstatement )
The First prefix to a LOAD or SELECT (SQL) statement is used for loading a set maximum number of records from a data source table.
First n( loadstatement | selectstatement )
The generic prefix unpacks a tall table, creating one field per attribute value. This is similar to pivoting a table, except that it results in a separate table per field created.
Generic ( loadstatement | selectstatement )
The hierarchy prefix is used to transform a parent-child hierarchy table to a table that is useful in a QlikView data model. It can be put in front of a LOAD or a SELECT statement and will use the result of the loading statement as input for a table transformation.
Hierarchy (NodeID, ParentID, NodeName, [ParentName], [PathSource], [PathName], [PathDelimiter], [Depth])(loadstatement | selectstatement)
This prefix is used to transform a parent-child hierarchy table to a table that is useful in a QlikView data model. It can be put in front of a LOAD or a SELECT statement and will use the result of the loading statement as input for a table transformation.
HierarchyBelongsTo (NodeID, ParentID, NodeName, AncestorID, AncestorName, [DepthDiff])(loadstatement | selectstatement)
This clause is used with the Info prefix or the Bundle prefix to resize images from a database management system to fit in the fields.
Info [Image_Size(width,height )] ( loadstatement | selectstatement )
The info prefix is used to link external information, such as a text file, a picture or a video to a field value.
Info( loadstatement | selectstatement )
The join and keep prefixes can be preceded by the prefix inner.If used before join it specifies that an inner join should be used. The resulting table will thus only contain combinations of field values from the raw data tables where the linking field values are represented in both tables. If used before keep, it specifies that both raw data tables should be reduced to their common intersection before being stored in QlikView. .
Inner ( Join | Keep) [ (tablename) ](loadstatement |selectstatement )
The IntervalMatch prefix is used to create a table matching discrete numeric values to one or more numeric intervals, and optionally matching the values of one or several additional keys.
IntervalMatch (matchfield)(loadstatement | selectstatement )
IntervalMatch (matchfield,keyfield1 [ , keyfield2, ... keyfield5 ] ) (loadstatement | selectstatement )
The join prefix joins the loaded table with an existing named table or the last previously created data table.
[Inner | Outer | Left | Right ] Join [ (tablename ) ]( loadstatement | selectstatement )
The keep prefix is similar to the join prefix. Just as the join prefix, it compares the loaded table with an existing named table or the last previously created data table, but instead of joining the loaded table with an existing table, it has the effect of reducing one or both of the two tables before they are stored in QlikView, based on the intersection of table data. The comparison made is equivalent to a natural join made over all the common fields, i.e. the same way as in a corresponding join. However, the two tables are not joined and will be kept in QlikView as two separately named tables.
(Inner | Left | Right) Keep [(tablename ) ]( loadstatement | selectstatement )
The Join and Keep prefixes can be preceded by the prefix left.
If used before join it specifies that a left join should be used. The resulting table will only contain combinations of field values from the raw data tables where the linking field values are represented in the first table. If used before keep, it specifies that the second raw data table should be reduced to its common intersection with the first table, before being stored in QlikView.
Left ( Join | Keep) [ (tablename) ](loadstatement |selectstatement )
The mapping prefix is used to create a mapping table that can be used to, for example, replacing field values and field names during script execution.
Mapping ( loadstatement | selectstatement )
The NoConcatenate prefix forces two loaded tables with identical field sets to be treated as two separate internal tables, when they would otherwise be automatically concatenated.
NoConcatenate( loadstatement | selectstatement )
The explicit Join prefix can be preceded by the prefix outer in order to specify an outer join. In an outer join all combinations between the two tables are generated. The resulting table will thus contain combinations of field values from the raw data tables where the linking field values are represented in one or both tables. The outer keyword is optional.
Outer Join [ (tablename) ](loadstatement |selectstatement )
The replace prefix is used to drop the entire QlikView table and replace it with a new table that is loaded or selected.
Replace[only](loadstatement |selectstatement |map...usingstatement)
The Join and Keep prefixes can be preceded by the prefix right.
If used before join it specifies that a right join should be used. The resulting table will only contain combinations of field values from the raw data tables where the linking field values are represented in the second table. If used before keep, it specifies that the first raw data table should be reduced to its common intersection with the second table, before being stored in QlikView.
Right (Join | Keep) [(tablename)](loadstatement |selectstatement )
The sample prefix to a LOAD or SELECT statement is used for loading a random sample of records from the data source.
Sample p ( loadstatement | selectstatement )
Tables containing relations between records can be loaded through a semantic prefix. This can for example be self-references within a table, where one record points to another, such as parent, belongs to, or predecessor.
Semantic ( loadstatement | selectstatement)
The unless prefix and suffix is used for creating a conditional clause which determines whether a statement or exit clause should be evaluated or not. It may be seen as a compact alternative to the full if..end if statement.
(Unless condition statement | exitstatement Unless condition )
The when prefix and suffix is used for creating a conditional clause which determines whether a statement or exit clause should be executed or not. It may be seen as a compact alternative to the full if..end if statement.
( When condition statement | exitstatement when condition )