Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

D toc

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:

 

D s
snippetBasic

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 s
snippetSyntax

D code

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

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

D s lang notes

D s
snippetExamples

Example - Rolling window functions

Include Page
EXAMPLE - Rolling Functions
EXAMPLE - Rolling Functions

D s also
labelwindow