Data Ranking

Updated at:
Copy as MD

Data ranking sorts data by value so you can compare measures and make informed decisions. You can rank measures in ascending or descending order across all data or within groups.

Prerequisites

Limits

  • Data ranking is calculated on the returned result set. The current upper limit in the public cloud is 10,000. If the total returned data exceeds 10,000, the ranking results may not meet expectations.

  • The following charts support data ranking.

    Data ranking method

    Description

    Supported chart types

    Overall ranking

    Ranks a data point among all data points.

    • Line/Area charts: line chart, area chart, stacked area chart, 100% stacked area chart, combination chart.

    • Column/Bar charts: column chart, stacked bar chart, 100% stacked bar chart, circular column chart, leaderboard, bar chart, stacked bar chart, 100% stacked bar chart, dynamic bar chart, waterfall chart.

    • Bubble/Scatter charts: bubble chart, scatter chart, facet scatter chart.

    • Table charts: cross table, detail table, heat map.

    • Pie/Ring charts: pie chart, rose chart, radar chart, treemap chart.

    • Geographic charts: color map, bubble map, heat map, flow map, symbol map.

    • Metric charts: metric card, metric trend chart.

    • Funnel/Conversion charts: funnel chart, comparison funnel chart.

    • Other charts: word cloud.

    Group ranking

    Ranks a data point within its group.

    • Table charts: cross table.

Configuration Entry

In the Fields panel of the chart, find the target measure field, click the image icon next to it, and select Advanced Calculation > Ranking. Then configure the ranking type for your scenario.

image

The available ranking calculation types and methods vary by chart type.

  • Ranking calculation types

    Chart type

    Ranking calculation type

    Limitations

    Calculation logic

    Cross table

    Ascending

    /

    Ranks the overall data from smallest to largest based on metric values.

    Descending

    /

    Ranks the overall data from largest to smallest based on metric values.

    Ascending within group

    /

    Groups data by the finest granularity and ranks data points from smallest to largest within each group. For example, if there are three dimensions: region, province, and city, cities are grouped by their respective provinces and regions, and then ranked in ascending order.image

    Descending within group

    /

    Groups data by the finest granularity and ranks data points from largest to smallest within each group.

    Custom

    Rank by column

    Dimension fields in the Row area

    Treats each column as an independent unit and ranks data points within that column.

    Rank within column group

    Two or more dimension fields in the Row area

    Ranks the current data point within its column group.

    The grouping logic is as follows: starting from the first dimension in the row area up to the selected grouping dimension, all dimensions in between are treated as a whole for grouping. For example, in the following figure, the Region and Province fields are matched for grouping, and ranking is performed at the Province dimension.image

    Rank by row

    Dimension fields in the Column area

    Treats each row as an independent unit and ranks data points within that row.

    Rank within row group

    Two or more dimension fields in the Column area

    Ranks the current data point within its row group.

    The grouping logic is as follows: starting from the first dimension in the column area up to the selected grouping dimension, all dimensions in between are treated as a whole for grouping. For example, in the following figure, grouping is performed on the Shipping Mode field, and ranking is done within this dimension.image

    Other charts

    Ascending

    /

    Ranks the overall data from smallest to largest based on metric values.

    Descending

    /

    Ranks the overall data from largest to smallest based on metric values.

    Custom

    /

    Allows you to customize the ranking order and method.

  • Ranking method: When a chart uses the Custom ranking calculation type, you can configure the Ranking order and Ranking method. The ranking method determines how duplicate values are handled.image

    Ranking method

    Description

    Example

    Rank

    Duplicate values share the same rank, and subsequent ranks are skipped.

    1, 2, 2, 4

    Dense rank

    Duplicate values share the same rank, and no ranks are skipped.

    1, 2, 2, 3

    Sequential rank

    Duplicate values receive different sequential ranks.

    1, 2, 3, 4

Application example 2: Setting up ranking in other visualization charts

The following example uses a metric card.

  1. Log on to the Quick BI console.

  2. Follow the steps shown in the figure below to enter the dashboard editing page.

    image.png

  3. In the top menu bar, click Add Chart, find Metric Card, and click or drag it to the dashboard area.image

  4. In the Data Panel's Fields tab, configure the metric card data.

    The target dataset is company_sales_record.

    1. Select the required dimension and measure fields, double-click or drag them to the target area.

      • In the Dimensions list, find Region, double-click or drag it to the Row area.

      • In the Measures list, find Order Amount, double-click or drag it to the Column area.

    2. Click Update.

      The system automatically creates a metric card for you, as shown in the following figure.image.png

  5. Click the 更多 icon to the right of Order amount, select Advanced Calculation -> Ranking, and follow the steps shown in the figure below to enter the ranking settings.image.png

  6. Visualization charts support Ascending and Descending ranking.

  7. Click Update.

    The Order amount ranking in the metric card is shown in the figure below.

    • When Ascending ranking is selected for Order amount, the largest Order amount is ranked last. In this example, the South China region has the largest Order amount and is ranked No.7.image.png

    • When Descending ranking is selected for Order amount, the largest Order amount is ranked first. In this example, the South China region has the largest Order amount and is ranked No.1.image.png

Application Examples

The following examples demonstrate data ranking in different chart types.

Example 1: Metric Card

The following example uses a metric card.

  1. Log on to the Quick BI console.

  2. Follow the steps shown in the figure below to enter the dashboard editing page.

    image.png

  3. In the top menu bar, click Add Chart, find Metric Card, and click or drag it to the dashboard area.image.png

  4. In the Data Panel's Fields tab, configure the metric card data.

    Select the required dimension and measure fields, double-click or drag them to the target area.

    • In the Dimensions list, find Region, double-click or drag it to the Row area.

    • In the Measures list, find Order amount, double-click or drag it twice to the Column area.

      Note

      Of the two Order amount fields in the Column area, one displays the raw data and the other is set for cumulative calculation.

      When there are two duplicate fields placed on measures, you will see a "Duplicate items exist in measures" prompt. Do not update the data yet. Update after the configuration is complete.

  1. Click the image icon next to the second Order amount field, select Advanced Calculation > Ranking. You can set different ranking methods for the current chart as needed. Specific examples are shown below.image

    Ranking calculation type

    Description

    Example effect

    Ascending

    Overall data is ranked from smallest to largest, so the largest Order amount is ranked last. In this example, the Southwest region has the largest Order amount and is ranked No.7.

    image

    Descending

    Overall data is ranked from largest to smallest, so the largest Order amount is ranked first. In this example, the Southwest region has the largest Order amount and is ranked No.1.

    image

    Custom

    In this example, Descending order is selected

    Rank

    Duplicate values share the same rank, and subsequent ranks are skipped. In this example, Northeast and East China have the same Order amount, both ranked No.4, so No.5 is skipped.

    image

    Dense rank

    Duplicate values share the same rank, and no ranks are skipped. In this example, Northeast and East China have the same Order amount, both ranked No.4, and No.5 still exists.

    image

    Sequential rank

    Duplicate values receive different sequential ranks. In this example, Northeast and East China have the same Order amount, but they are ranked No.4 and No.5 respectively.

    image

Example 2: Cross Table

Cross tables support additional ranking calculation methods compared to other charts.

Ranking calculation type

Configuration description

Example effect

Ascending

Overall data is ranked from smallest to largest, so the largest Order amount is ranked last. In this example, the South China region has the largest Order amount and is ranked No.7.

image

Descending

Overall data is ranked from largest to smallest, so the largest Order amount is ranked first. In this example, the South China region has the largest Order amount and is ranked No.1.

image

Ascending within group

In this example, provinces are grouped by the region dimension, and Order amounts are ranked from smallest to largest within each region. For example, in the Northeast region, Heilongjiang Province has the smallest Order amount and is ranked No.1.

image

Descending within group

In this example, provinces are grouped by the region dimension, and Order amounts are ranked from largest to smallest within each region. For example, in the Northeast region, Heilongjiang Province has the smallest Order amount and is ranked No.3.

image

Custom

In this example, Descending and Rank are set

Rank by column

In this example, the overall data is ranked in descending order by individual columns. For example, in the Truck shipping mode, South China has the highest Order amount and is ranked No.1.

image

Rank within column group

In this example, both the first dimension field and the grouping dimension in the Row area are Region, so grouping and descending ranking are based on the Region dimension. For example, in the Northeast region, Heilongjiang Province has the lowest Order amount transported by truck and is ranked No.3.

image

Rank by row

In this example, the overall data is ranked in descending order by individual rows. For example, in Jilin Province, the Train shipping mode has the highest Order amount and is ranked No.1.

image

Rank within row group

In this example, both the first dimension field and the grouping dimension in the Column area are Product Type, so grouping and descending ranking are based on the Product Type dimension. For example, for office supplies orders in Jilin Province, the Train shipping mode has the highest Order amount and is ranked No.1.

image