Concatenating tables

Automatic concatenation

If the field names and the number of fields of two or more loaded tables are exactly the same, QlikView will automatically concatenate the content of the different statements into one table.

Example:  

LOAD a, b, c from table1.csv;

LOAD a, c, b from table2.csv;

The resulting internal table has the fields a, b and c. The number of records is the sum of the numbers of records in table 1 and table 2.

Note: The number and names of the fields must be exactly the same. The order of the two statements is arbitrary.

Forced concatenation

Even if two or more tables do not have exactly the same set of fields, it is still possible to force QlikView to concatenate the two tables. This is done with the concatenate prefix in the script, which concatenates a table with another named table or with the last previously created table.

Example:  

LOAD a, b, c from table1.csv;

concatenate LOAD a, c from table2,csv;

 

The resulting internal table has the fields a, b and c. The number of records in the resulting table is the sum of the numbers of records in table 1 and table 2. The value of field b in the records coming from table 2 is NULL.

Note: The number and names of the fields must be exactly the same. Unless a table name of a previously loaded table is specified in the concatenate statement the concatenate prefix uses the last previously created table. The order of the two statements is thus not arbitrary.

Preventing concatenation

If the field names and the number of fields of two or more loaded tables are exactly the same, QlikView will automatically concatenate the content of the different statements into one table. This is possible to prevent with a noconcatenate statement. The table loaded with the associated LOAD or SELECT statement will then not be concatenated with the existing table.

Example:  

LOAD a, b, c from table1.csv;

noconcatenate LOAD a, b, c from table2.csv;

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?