row_rank_min()

Returns the current row's minimal rank in a serialized row set.

The rank is the minimal row number that the current row's Term appears in.

Syntax

row_rank_min ( Term )

Learn more about syntax conventions.

Parameters

Name Type Required Description
Term string ✔️ An expression indicating the value to consider for the rank. The rank is the minimal row number for Term.
restart bool Indicates when the numbering is to be restarted to the StartingIndex value. The default is false.

Returns

Returns the row rank of the current row as a value of type long.

Example

The following query shows how to rank the Airline by the number of departures from the SEA Airport.

datatable (Airport:string, Airline:string, Departures:long)
[
  "SEA", "LH", 3,
  "SEA", "LY", 100,
  "SEA", "UA", 3,
  "SEA", "BA", 2,
  "SEA", "EL", 3
]
| sort by Departures asc
| extend Rank=row_rank_min(Departures)

Output

Airport Airline Departures Rank
SEA BA 2 1
SEA LH 3 2
SEA UA 3 2
SEA EL 3 2
SEA LY 100 5