The Peek function

Another tool we'll add to our collection in this set of data transformation techniques is the Peek function. The Peek function is an inter-record function that allows us to literally peek into previously-read records of a table and use its values to evaluate a condition or to affect the active record (the one being read).

The function takes one mandatory parameter, the field name into which we will "peek", and two optional parameters, a row reference and the table in which the field is located.

For example, an expression like:

Peek('Date', -2)

This expression will go back two records in the currently-being-read table, take the value on the Date field and use it as a result of the expression.

Or take this other expression:

Peek('Date', ...

Get QlikView 11 for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.