← All nodes
Transformations

Rank

Adds a SQL RANK() column: rows are numbered by the order you choose, tied rows share a number, and the next number skips the ties.

When to use it

Use it for league tables and top-N work — best-selling product per region, highest score per class — where two equal rows should share a place.

In a pipeline

Settings

SettingTypeRequiredDefault or hint
New Column NametextYesRank
Insert Afterselect—End of table
Partition Byselect—Whole table (no partition)
Order Byselect—Order rows arrive in
Order Directionselect—asc

Example

Sales rank within each region

  • New Column Name=Sales Rank
  • Insert After=Sales
  • Partition By=Region
  • Order By=Sales
  • Order Direction=Descending
Incoming rows
RegionRepSales
NorthAda900
NorthBen900
NorthCy500
SouthDee700
Ada and Ben tie, so Cy is third
RegionRepSalesSales Rank
NorthAda9001
NorthBen9001
NorthCy5003
SouthDee7001

Rows keep the order they arrived in; only the new column is added.

Worth knowing

  • Partition By restarts the numbering for each group, exactly like PARTITION BY in SQL. Leave it empty to rank the whole table.
  • Order By decides what counts as first. With nothing chosen, rows are numbered in the order they arrive and nothing ties.
  • Insert After puts the new column straight after a column you pick; leave it on End of table to append it.
  • Empty cells sort before values, as they do in SQL Server and MySQL.

Others in Transformations