← All nodes
Transformations

Dense Rank

Adds a SQL DENSE_RANK() column: tied rows share a number, and the next number follows on with no gap.

When to use it

Use it when you want the distinct levels counted — price bands, grade tiers, 'the three best scores' — rather than the position in a list.

In a pipeline

Settings

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

Example

Score tiers in a class

  • New Column Name=Tier
  • Order By=Score
  • Order Direction=Descending
Incoming rows
PupilScore
Ada95
Ben95
Cy88
Dee70
No gap after the tie
PupilScoreTier
Ada951
Ben951
Cy882
Dee703

Rank would have given Cy 3; Dense Rank gives 2, because it counts levels rather than positions.

Worth knowing

  • Dense Rank and Rank differ only in the ties: Rank leaves gaps after them, Dense Rank does not.
  • Partition By restarts the numbering for each group, and Order By decides the order within it.
  • To keep only the top three levels, follow this node with Filter Rows on the new column.

Others in Transformations