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.

it possible to refer also to fields which have not been loaded into <strong>QlikView</strong>, i.e. even if they have not been<br />

stored in its associative database.<br />

Examples:<br />

Load *, Sales / previous(Sales) as Increase from ...;<br />

Load A, previous(previous( A )) as B from ...;<br />

peek(fieldname [ , row [ , tablename ] ] )<br />

Returns the contents of the fieldname in the record specified by row in the internal table tablename. Data<br />

are fetched from the associative <strong>QlikView</strong> database.<br />

Fieldname must be given as a string (e.g. a quoted literal).<br />

Row must be an integer. 0 denotes the first record, 1 the second and so on. Negative numbers indicate order<br />

from the end of the table. -1 denotes the last record read.<br />

If no row is stated, -1 is assumed.<br />

Tablename is a table label, see Table Labels (page 273), without the ending colon. If no tablename is<br />

stated, the current table is assumed. If used outside the load statement or referring to another table, the tablename<br />

must be included.<br />

Examples:<br />

peek( 'Sales' )<br />

returns the value of Sales in the previous record read ( equivalent to previous(Sales) ).<br />

peek( 'Sales', 2 )<br />

returns the value of Sales from the third record read from the current internal table.<br />

peek( 'Sales', -2 )<br />

returns the value of Sales from the second last record read into the current internal table.<br />

peek( 'Sales', 0, 'Tab1' )<br />

returns the value of Sales from the first record read into the input table labeled Tab1.<br />

Load A, B, numsum( B, peek( 'Bsum' ) ) as Bsum...;<br />

creates an accumulation of B in Bsum.<br />

FieldValue(fieldname , n )<br />

Returns the field value found in position n of the field fieldname (by load order). fieldname must be given<br />

as a string value, e.g. the field name must be enclosed by single quotes. The first field value is returned for<br />

n=1. If n is larger than the number of field values, NULL is returned.<br />

Example:<br />

FieldValue( 'HelpText', 5 )<br />

FieldIndex(fieldname , value )<br />

Returns the position of the field value value found in the field fieldname (by load order). If value cannot be<br />

found among the field values, 0 is returned. fieldname must be given as a string value, e.g. the field name<br />

must be enclosed by single quotes.<br />

Example:<br />

FieldIndex( 'Name', 'John Doe' )<br />

lookup(fieldname, matchfieldname, matchfieldvalue [, tablename])<br />

327

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

Saved successfully!

Ooh no, something went wrong!