Early Access: The content on this website is provided for informational purposes only in connection with pre-General Availability Qlik Products.
All content is subject to change and is provided without warranty.
Skip to main content Skip to complementary content

Above - chart function

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() evaluates for the row above the current row in the chart's straight table equivalent.

Syntax:  

Above([TOTAL] expr [ , offset [,count]])

Return data type: dual

Arguments
Argument Description
expr The expression or field containing the data to be measured.
offset Specifying an offset n, greater than 0, moves the evaluation of the expression n rows further up from the current row.

Specifying an offset of 0 will evaluate the expression on the current row.

Specifying a negative offset number makes the Above function work like the Below function with the corresponding positive offset number.

count By specifying a third argument count greater than 1, the function will return a range of count values, one for each of count table rows counting upwards from the original cell.

In this form, the function can be used as an argument to any of the special range functions. Range functions

TOTAL If the table is one-dimensional or if the qualifier TOTAL is used as argument, the current column segment is always equal to the entire column.

Defining the aggregation scope

On the first row of a column segment, a NULL value is returned, as there is no row above it.

Information noteA column segment is defined as a consecutive subset of cells having the same values for the dimensions in the current sort order. Inter-record chart functions are computed in the column segment excluding the right-most dimension in the equivalent straight table chart. If there is only one dimension in the chart, or if the TOTAL qualifier is specified, the expression evaluates across full table.
Information noteIf the table or table equivalent has multiple vertical dimensions, the current column segment will include only rows with the same values as the current row in all dimension columns, except for the column showing the last dimension in the inter-field sort order.

Limitations:  

  • Recursive calls will return NULL.

  • Sorting on y-values in charts or sorting by expression columns in tables is not allowed when this chart function is used in any of the chart's expressions. These sort alternatives are therefore automatically disabled. When you use this chart function in a visualization or table, the sorting of the visualization will revert back to the sorted input to this function.

Example: Chart expressions
Example Result

Above( Sum(Sales) )

Returns the value of Sales for the row above the current row.

Example - Above fundamentals

Example - Above scenario

Example - Chart expression using Above

Example - Above scenario based on sort order

Example - Above scenario using a different sort order

Example - Using the Above function with RangeAvg

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!