Berserk Docs
Scalar FunctionsOther Functions

row_rank_dense

Returns the dense rank of a column in a serialized row set: the rank starts at 1 and increments by 1 each time the column value changes, with no gaps. An optional restart argument resets the rank to 1 when true. A row set is serialized by the sort, top, top-hitters, or serialize operators; order-preserving operators (extend, project, where, ...) keep that property. Only valid in a serialized context.

Syntax

row_rank_dense(term, restart)

Parameters

Prop

Type

Returns: long

Examples

Example 1

datatable(weapon:string)[
  "axe",
  "axe",
  "sword",
  "spear"
]
| sort by weapon asc
| extend rank = row_rank_dense(weapon)
weapon (string)rank (long)
axe1
axe1
spear2
sword3

On this page