Skip to main content
Row functions let you reference values from other rows without writing raw SQL window functions. They use the ${table.column} syntax to reference fields in your results table.
Row functions use your query’s current sort order to determine row positions. Changing the sort order of your results will change the output of these functions.

row

Returns the 1-based row number of the current row.
Parameters: None Example Add a row number column to your results:
The ORDER BY clause uses the sort order configured in your query.

offset

Returns the value of a column from a row at a relative offset from the current row.
Example Get the previous row’s revenue to calculate period-over-period changes:
For negative offsets (previous rows):
For positive offsets (next rows):
For an offset of 0, the column value is returned directly with no window function.

index

Returns the value of an expression from an absolute row position (1-based).
Example Compare every row’s revenue against the first row’s revenue:

lookup

Finds a value in one column and returns the corresponding value from another column.
If multiple rows match, the largest matching value from resultColumn is returned. Example Look up the revenue for a specific status:

offset_list

Returns an array of values from consecutive rows starting at a relative offset.
Example Get the current and two previous revenue values (a 3-period window):

list

Constructs an array from multiple values. Unlike the other row functions, list does not use any windowing.
Example Create an array of specific column values: