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) |
|---|---|
| axe | 1 |
| axe | 1 |
| spear | 2 |
| sword | 3 |
row_number
Returns the current row number in the serialized row set.
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.