dense_rank
Aliases: denserank (deprecated).
dense_rank() -> int64
Returns the dense rank within an ordered group of values.
Default ordering is in ascending time, so the first value has the lowest rank.
dense_rank orders the group by values and does not allow gaps. See also rank.
Domain
This is a window function (calculates over a group of multiple input rows using windowing).
Categories
Examples
make_col index:window(dense_rank(), group_by(category_id), order_by(item_cost))
Assigns a dense rank to items, when ordered by cost, grouped by category. The cheapest item in each category will be given the rank 1, items with the same cost within the same category will receive the same rank. Dense means there are no gaps assigned between ranks.
Updated 8 days ago