Excerpt |
---|
Generates a new column containing the row number as sorted by the order parameter and optionally grouped by the group parameter. |
Tip |
---|
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:
D code |
---|
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:
D code |
---|
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.
D code |
---|
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
Include Page |
---|
| EXAMPLE - Rolling Functions |
---|
| EXAMPLE - Rolling Functions |
---|
|