Rank

The Rank step allows you to order your data based on specific values, with options for different ranking methods. This is useful for identifying top performers, prioritizing items, or creating ordered lists within your dashboard.

Steps parameters

  • Value column to rank column(string)*: the value column that will be ordered to determine rank

  • Sort order dropdown["asc", "desc"]*: how to order the value column to determine ranking. Either asc(ending) or desc(ending), desc by default

  • Ranking method dropdown["standard", "dense"]*: either standard or dense, as explained above

  • Group ranking by column(array) (optional): if you need to apply the ranking computation by group of rows, you may specify here the columns to be used to constitute groups (see example 2 below)

  • New column name(string) (optional): if you want to give a custom name to the output column to be created (by default it will be your original column name suffixed by _RANK).

Example

Input

Compute - Rank input

Configuration

{
    "value_col": "sales",
    "order": "standard",
    "method": "asc",
    "group_by": [],
    "new_column_name": "sales_rank_asc"
}

Output

Compute - Rank output

There are 2 ranking methods available, that you will understand easily through those examples:

  • standard: input = [10, 20, 20, 20, 25, 25, 30] => ranking = [1, 2, 2, 2, 5, 5, 6]

  • dense: input = [10, 20, 20, 20, 25, 25, 30] => ranking = [1, 2, 2, 2, 3, 3, 4]

(The dense method is basically the same as the standard method, but rank always increases by 1 at most).

Last updated

Was this helpful?