- Working with QlikView
- Script syntax and chart functions
- Functions in scripts and chart expressions
- Inter-record functions

#
Inter-record functions

Inter-record functions are used:

- In the load script, when a value from previously loaded records of data is needed for the evaluation of the current record.
- In a chart expression, when another value from the data set of a chart is needed.

## Row functions

These functions can only be used in chart expressions.Above() evaluates an expression at a row above the current row within a column segment in a table. The row for which it is calculated depends on the value of offset, if present, the default being the row directly above. For charts other than tables,

**above**([TOTAL [<fld{,fld}>]] expr
[ , offset [,count]])

Below() evaluates an expression at a row below the current row within a column segment in a table. The row for which it is calculated depends on the value of offset, if present, the default being the row directly below. For charts other than tables,

**below**([TOTAL[<fld{,fld}>]] expression
[ , offset [,count
]])

**bottom**([TOTAL[<fld{,fld}>]] expr
[ , offset [,count
]])

**top**([TOTAL [<fld{,fld}>]] expr [ , offset [,count
]])

**noofrows**([TOTAL])

## Column functions

These functions can only be used in chart expressions.Column() returns the value found in the column corresponding to ColumnNo in a straight table, disregarding dimensions. For example

**column**(ColumnNo)

**dimensionality** ( )

Secondarydimensionality() returns the number of dimension pivot table rows that have non-aggregation content, that is, do not contain partial sums or collapsed aggregates. This function is the equivalent of the dimensionality() function for horizontal pivot table dimensions.

## Field functions

FieldIndex() returns the position of the field value value in the field field_name (by load order).

**fieldindex**(field_name ,
value)

FieldValue() returns the value found in position elem_no of the field field_name (by load order).

**fieldvalue**(field_name , elem_no)

FieldValueCount() is an integer function that finds the number of distinct values in a field.

**fieldvaluecount**(field_name)

## Pivot table functions

These functions can only be used in chart expressions.After() returns the value of an expression evaluated with a pivot table's dimension values as they appear in the column after the current column within a row segment in the pivot table.

**after**([TOTAL] expression
[ , offset [,n]])

Before() returns the value of an expression evaluated with a pivot table's dimension values as they appear in the column before the current column within a row segment in the pivot table.

**before**([TOTAL] expression
[ , offset [,n]])

First() returns the value of an expression
evaluated with a pivot table's dimension values as they appear in the
first column of the current row segment in the pivot table. This function
returns

**first**([TOTAL] expression
[ , offset [,n]])

Last() returns the value of
an expression evaluated with a pivot table's dimension values as they appear in the
last column of the current row segment in the pivot table. This function
returns

**last**([TOTAL] expression
[ , offset [,n]])

ColumnNo() returns the number of the current column within the current row segment in a pivot table. The first column is number 1.

**columnno**([TOTAL])

NoOfColumns() returns the number of columns in the current row segment in a pivot table.

**noofcolumns**([TOTAL])

## Inter-record functions in the load script

Exists() determines whether a specific field
value has already been loaded into the field in the load script. The function returns

**Exists**(field
[ , expression ]

Lookup() looks into a table that is already loaded and returns the value of field_name corresponding to the first occurrence of the value match_field_value in the field match_field_name. The table can be the current table or another table previously loaded.

**LookUp**(fieldname,
matchfieldname, matchfieldvalue [, tablename])

Peek() finds the value of a field in a table for a row that has already been loaded or that exists in internal memory. The row number can be specified, as can the table.

**Peek**(fieldname [ , row [ , tablename ] ]

Previous() finds the value of the expr expression using data from the previous input record. In the first record
of an internal table, the function will return

**Previous**(expression )

See also: