Berserk Docs
Scalar FunctionsOther Functions

row_rank_min

Returns the minimum rank of a column in a serialized row set: each row in a run of equal column values gets the 1-based position of the first row in that run, so ranks jump by the run length. An optional restart argument resets the rank 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_min(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_min(weapon)
weapon (string)rank (long)
axe1
axe1
spear3
sword4

On this page