Table calculation functions are an Experimental feature.These functions may change or be updated without notice as we iterate. See feature maturity levels for details.
${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.Compiled SQL
Compiled SQL
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.| Parameter | Type | Description |
|---|---|---|
column | column reference | The column to get the value from |
rowOffset | integer | Number of rows to offset. Negative = previous rows, positive = next rows, 0 = current row |
Compiled SQL
Compiled SQL
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).| Parameter | Type | Description |
|---|---|---|
expression | column reference or SQL expression | The expression to evaluate |
rowIndex | integer (≥ 1) | The 1-based row position to get the value from |
Compiled SQL
Compiled SQL
lookup
Finds a value in one column and returns the corresponding value from another column.| Parameter | Type | Description |
|---|---|---|
value | any | The value to search for |
lookupColumn | column reference | The column to search in |
resultColumn | column reference | The column to return the value from |
resultColumn is returned.
Example
Look up the revenue for a specific status:
Compiled SQL
Compiled SQL
offset_list
Returns an array of values from consecutive rows starting at a relative offset.| Parameter | Type | Description |
|---|---|---|
column | column reference | The column to get values from |
rowOffset | integer | Starting row offset. Negative = previous rows, positive = next rows, 0 = current row |
numValues | integer | Number of consecutive values to include |
Compiled SQL
Compiled SQL
list
Constructs an array from multiple values. Unlike the other row functions,list does not use any windowing.
| Parameter | Type | Description |
|---|---|---|
value1...valueN | any | Values or expressions to combine into an array |
Compiled SQL
Compiled SQL