dense_rank

Description

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.

Return type

int64

Domain

This is a window function (calculates over a group of multiple input rows using windowing.)

Categories

Usage

dense_rank()

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.

Aliases

denserank (deprecated)