Row Number - Teradata Warehouse Miner

Teradata® Warehouse Miner™ User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.6
Published
November 2018
Language
English (United States)
Last Update
2018-12-07
dita:mapPath
gxn1538171534877.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

The Row Number function returns a sequential number starting at 1 for each row in the answer set, based on sorting by one or more columns or expressions. Optionally, one or more columns or expressions can be specified to identify partitions in the result set such that the row number starts at 1 within each partition.

When dragging a Row Number function into a variable, the following tree element is created.

Variable Creation > Input > Variables: SQL Elements pane - Logical > Row Number

Sort expressions can be built up in the Sort Expressions folder and partition expressions can be built up in the Partition Columns folder. The following is an example of a Row Number request, sorting by cust_id in a descending order (note the use of the ASC/DESC Order SQL element) and partitioning by a combination of the columns gender and marital_status.

Variable Creation > Input > Variables: SQL Elements pane - Logical > Row Number (example)

There are no special properties for the Row Number function.