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.

For each..next page 234<br />

Do..loop page 231<br />

Switch..case..default..end switch page 268<br />

Exit Script page 233<br />

Sub..end sub page 267<br />

Call page 225<br />

Add<br />

The add prefix can be added to any Load (page 246), Select (SQL) (page 262) or Map ... using (page 254)<br />

statement in the script. It is only meaningful during partial reloads. During a partial reload the <strong>QlikView</strong><br />

table, for which a table name is generated by the add load/add select statement (provided such a table<br />

exists), will be appended with the result of the add load/add select statement. No check for duplicates is performed.<br />

Therefore, a statement using the add prefix will normally include either a distinct qualifier or a<br />

where clause guarding duplicates. The add map...using statement causes mapping to take place also during<br />

partial script execution.<br />

The syntax is:<br />

add [only] (loadstatement |selectstatement |map...usingstatement)<br />

where:<br />

only is an optional qualifier denoting that the statement should be disregarded during normal (non-partial)<br />

reloads.<br />

Examples:<br />

Tab1:<br />

load Name, Number from Persons.csv;<br />

add load Name, Number from newPersons.csv;<br />

During normal reload, data is loaded from Persons.csv and stored in the <strong>QlikView</strong> table Tab1. Data from<br />

NewPersons.csv is then concatenated to the same <strong>QlikView</strong> table. See concatenated.<br />

During partial reload, data is loaded from NewPersons.csv and appended to the <strong>QlikView</strong> table Tab1. No<br />

check for duplicates is made.<br />

Tab1:<br />

select Name, Number from Persons.csv;<br />

add load Name, Number from NewPersons.csv where not exists(Name);<br />

A check for duplicates is made by means of looking if Name exists in the previously loaded table data (see<br />

the function exists under exists(field [ , expression ]) (page 326)).<br />

During normal reload, data is loaded from Persons.csv and stored in the <strong>QlikView</strong> table Tab1. Data from<br />

NewPersons.csv is then concatenated to the same <strong>QlikView</strong> table.<br />

During partial reload, data is loaded from NewPersons.csv which is appended to the <strong>QlikView</strong> table Tab1. A<br />

check for duplicates is made by means of seeing if Name exists in the previously loaded table data.<br />

Tab1:<br />

load Name, Number from Persons.csv;<br />

add only load Name, Number from NewPersons.csv where not exists(Name);<br />

During normal reload, data is loaded from Persons.csv and stored in the <strong>QlikView</strong> table Tab1. The statement<br />

loading NewPersons.csv is disregarded.<br />

222

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

Saved successfully!

Ooh no, something went wrong!