Generates a new column containing the row number as sorted by the order parameter and optionally grouped by the group parameter.

Tip: To generate row identifiers by the original order in the source data, use the $sourcerownumber reference. See Source Metadata References.

This function works with the following transforms:

 

Example:

rownumber()

Output: Returns the row number of each row.

Example with grouping:

rownumber() order:Date group:QTR

Output: Returns the row number of each row as ordered by the values in the Date column grouped by the QTR values. For each quarter value, the row number counter resets.       

rownumber() order: order_col [group: group_col]

For more information on the order and group parameters, see Window Transform.

Example - Rolling window functions