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 SOURCEROWNUMBER. See SOURCEROWNUMBER Function.

This function works with the following transforms:

 

Example:

window ROWNUMBER() order:Date

Output: Generates the new column, which contains the row number of each row as ordered by the values in the Date column.

Example with grouping:

window ROWNUMBER() order:Date group:QTR

Output: Generates the new column , which contains 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.       

window value:ROWNUMBER() order: order_col [group: group_col]

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

Example - Rolling window functions