21.01.2013 Views

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

load * from file2.csv;<br />

.. .. ..<br />

join (tab1) load * from file3.csv;<br />

Back to Script Statements and Keywords (page 219).<br />

Keep<br />

The keep prefix between two Load (page 246) or Select (SQL) (page 262) statements has the effect of reducing<br />

one or both of the two tables before they are stored in <strong>QlikView</strong>, based on the intersection of table data.<br />

The keep keyword must always be preceded by one of the prefixes Inner (page 239), Left (page 244) or<br />

Right (page 259). The selection of records from the tables is made in the same way as in a corresponding<br />

join. However, the two tables are not joined and will be stored in <strong>QlikView</strong> as two separately named tables.<br />

Note!<br />

The explicit Join (page 243) keyword in <strong>QlikView</strong> script language performs a full join of the two tables.<br />

The result is one table. In many cases such joins will result in very large tables. One of the main features of<br />

<strong>QlikView</strong> is its ability to make associations between tables instead of joining them, which greatly reduces<br />

memory usage, increases processing speed and offers enormous flexibility. Explicit joins should therefore be<br />

generally avoided in <strong>QlikView</strong> scripts. The keep functionality was designed to reduce the number of cases<br />

where explicit joins needs to be used.<br />

Back to Script Statements and Keywords (page 219).<br />

Left<br />

The Join (page 243) and Keep (page 244) prefixes can be preceded by the prefix left.<br />

If used before join it specifies that a left join should be used. The resulting table will only contain combinations<br />

of field values from the raw data tables with a full set of data from the first table.<br />

If used before keep, it specifies that the second raw data table should be reduced to its common intersection<br />

with the first table, before being stored in <strong>QlikView</strong>.<br />

left( join | keep) [ (tablename ) ](loadstatement |selectstatement<br />

)<br />

Examples:<br />

Table1<br />

A B<br />

1 aa<br />

2 cc<br />

3 ee<br />

Table2<br />

244<br />

A C

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!