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.

Exit Script<br />

The exit script control statement stops script execution. It may be inserted anywhere in the script. An exit<br />

script statement can be made conditional by the optional use of when or unless clause. The syntax is:<br />

exit script[ (when | unless) condition ]<br />

Where<br />

condition is a logical expression evaluating to true or false.<br />

Since the exit script statement is a control statement and as such is ended with either a semicolon or end-ofline,<br />

it must not cross a line boundary.<br />

Examples:<br />

exit script<br />

exit script;<br />

exit script when a=1<br />

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

First<br />

The first prefix to a Load (page 246) or Select (SQL) (page 262) statement is used for loading just a set<br />

maximum number of records from the data source, regardless of its length.<br />

The syntax is:<br />

first n( loadstatement | selectstatement )<br />

where:<br />

n is an arbitrary expressing which evaluates to an integer indicating the maximum number of records to be<br />

read.<br />

Examples:<br />

First 10 Load * from abc.csv;<br />

First (1) Select * from Orders; (Note: The parenthesis is allowed but<br />

not required.)<br />

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

For..next<br />

The for..next control statement creates a loop with a counter. The statements inside the loop enclosed by for<br />

and next will be executed for each value of the counter variable between specified low and high limits. The<br />

syntax is:<br />

forcounter = expr1 to expr2 [ step expr3 ]<br />

[statements]<br />

[exit for [ ( when | unless ) condition ]<br />

[statements]<br />

next[counter]<br />

Where:<br />

counter is a script variable name. If counter is specified after next it must be the same variable name as the<br />

one found after the corresponding for.<br />

233

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

Saved successfully!

Ooh no, something went wrong!