All Products
Search
Document Center

Quick BI:Nested Calculation

Last Updated:Oct 30, 2025

A nested calculation applies two or more advanced calculations to a single measure field. This lets you perform multi-step calculations on one field. This topic describes how to configure nested calculations.

Prerequisites

Limitations

The following charts support nested calculations.

Chart type

Chart name

Table

Cross table, Detail table, Heat map.

Metric

Metric card, Metric trend.

Line/Area chart

Line chart, Area chart, Stacked chart, 100% stacked area chart, Combination chart.

Column/Bar chart

Column chart, Stacked column chart, 100% stacked column chart, Ring column chart, Ranking board, Bar chart, stacked bar chart, 100% stacked bar chart, Waterfall chart, Bullet chart, Box plot.

Pie/Ring chart

pie chart, Rose chart, Sunburst chart, Radar chart, treemap chart.

Bubble/Scatter chart

Bubble chart, Scatter chart, Facet scatter chart.

Funnel/Conversion chart

Funnel chart, Comparison funnel chart.

Geographic chart

Color map, Bubble map, heat map, Building heat map, Flying line map, Symbol map.

Other

Word cloud.

Configuration Entry

In the Fields panel of the chart, find the measure field to which you want to apply a nested calculation. Click the image icon to the right of the field and select Advanced Calculation > Nested Calculation. In the Nested Calculation dialog box, configure the logic for Advanced Calculation 1 and Advanced Calculation 2.

Note

When a nested calculation runs, Advanced Calculation 2 is performed on the results of Advanced Calculation 1.

image

Application Examples

The following examples use a cross table to help you understand nested calculations.

Example 1: Monthly cumulative sales ranking

Scenario: The current date is July 16, 2016. You need to calculate the cumulative Order amount for each area from July 1, 2016 to the current date, and rank them by amount. Therefore, you need to first perform Date Cumulative calculation on the Order amount field, and then Rank the results by size.

  1. In the Nested Calculation dialog box, set Advanced Calculation 1 to Date Cumulative.

    Date cumulative calculates the sum of data from the initial date to the current date. For more information about date cumulative configuration, see Date Cumulative.image

  2. Select Rank as the calculation method for Advanced Calculation 2, complete the related configuration, and click OK.

    Ranking sorts data by size. For more information about ranking configuration, see Data Ranking.image

  3. Set the date filter value to 2016-07-16 in the date query control, and click Query. The chart displays the ranking of cumulative Order amount for each area from July 1 to July 16, 2016.image

Example 2: Year-over-year comparison of monthly cumulative sales

Scenario: You need to compare the monthly cumulative Order amount for each area from July 1 to July 16, 2016 with the same period last year (July 1 to July 16, 2015). Therefore, you need to first use Year-over-Year/Month-over-Month calculation on the Order amount field to obtain the data for the same period, and then use Date Cumulative calculation on the results to get the monthly cumulative amount.

  1. In the Nested Calculation dialog box, set Advanced Calculation 1 to Year-over-Year/Month-over-Month and configure the parameters as required.

    Year-over-Year/Month-over-Month measures data changes in different periods through year-over-year and month-over-month comparisons. For more information about Year-over-Year/Month-over-Month calculation configuration, see Year-over-Year/Month-over-Month.image

  2. Select Date Cumulative as the calculation method for Advanced Calculation 2, complete the related configuration, and click OK.

    Date cumulative calculates the sum of data from the initial date to the current date. For more information about date cumulative configuration, see Date Cumulative.image

  3. Set the date filter value to 2016-07-16 in the date query control, and click Query. The chart displays the specific data of monthly cumulative Order amount for each area from July 1 to July 16, 2015. image

Example 3: Year-over-year comparison of sales percentage

Scenario: You need to compare the percentage of Order amount for each area in July 2016 with the same period last year (July 2015). Therefore, you need to first use Year-over-Year/Month-over-Month calculation on the Order amount field to obtain the data for the same period, and then use Percentage calculation on the results to get the percentage of Order amount for the same period.

  1. In the Nested Calculation dialog box, set Advanced Calculation 1 to Year-over-Year/Month-over-Month and configure the parameters as required.

    Year-over-Year/Month-over-Month measures data changes in different periods through year-over-year and month-over-month comparisons. For more information about Year-over-Year/Month-over-Month calculation configuration, see Year-over-Year/Month-over-Month.

    image

  2. Select Percentage as the calculation method for Advanced Calculation 2, complete the related configuration, and click OK.

    Percentage calculation represents the proportion of a specific data point within the overall data. For more information about percentage calculation configuration, see Percentage Calculation.

    image

  3. Set the date filter value to 2016-07 in the date query control, and click Query. The chart displays the percentage of Order amount for each area in July 2015. image

Example 4: Year-over-year comparison of sales ranking

Scenario: You need to compare the ranking of Order amount for each area in July 2016 with the same period last year (July 2015). Therefore, you need to first use Year-over-Year/Month-over-Month calculation on the Order amount field to obtain the data for the same period, and then use Rank on the results to get the ranking of Order amount for each area in the same period.

  1. In the Nested Calculation dialog box, set Advanced Calculation 1 to Year-over-Year/Month-over-Month and configure the parameters as required.

    Year-over-Year/Month-over-Month measures data changes in different periods through year-over-year and month-over-month comparisons. For more information about Year-over-Year/Month-over-Month calculation configuration, see Year-over-Year/Month-over-Month.

    image

  2. Select Rank as the calculation method for Advanced Calculation 2, complete the related configuration, and click OK.

    Ranking sorts data by size. For more information about ranking configuration, see Data Ranking.

    image

  3. Set the date filter value to 2016-07 in the date query control, and click Query. The chart displays the ranking of Order amount for each area in July 2015. image

Example 5: Year-over-year comparison of sales percentile

Scenario: You need to compare the percentile of Order amount for each area in July 2016 with the same period last year (July 2015). Therefore, you need to first use Year-over-Year/Month-over-Month calculation on the Order amount field to obtain the data for the same period, and then use Percentile calculation on the results to get the percentile of Order amount for each area in the same period.

  1. In the Nested Calculation dialog box, set Advanced Calculation 1 to Year-over-Year/Month-over-Month and configure the parameters as required.

    Year-over-Year/Month-over-Month measures data changes in different periods through year-over-year and month-over-month comparisons. For more information about Year-over-Year/Month-over-Month calculation configuration, see Year-over-Year/Month-over-Month.

    image

  2. Select Percentile as the calculation method for Advanced Calculation 2, complete the related configuration, and click OK.

    Percentile ranks the results returned from the database in percentile form. For more information about percentile configuration, see Percentile.

    image

  3. Set the date filter value to 2016-07 in the date query control, and click Query. The chart displays the percentile of Order amount for each area in July 2015. image

Example 6: View the top 3 areas by order amount in the same period last year

Scenario: The current time is July 2016. You need to filter the top 3 areas by Order amount in the same period last year (July 2015). Therefore, you need to first use Year-over-Year/Month-over-Month calculation on the Order amount field to obtain the data for the same period, and then use TopN filtering on the results to quickly obtain the relevant areas.

  1. In the Nested Calculation dialog box, set Advanced Calculation 1 to Year-over-Year/Month-over-Month and configure the parameters as required.

    Year-over-Year/Month-over-Month measures data changes in different periods through year-over-year and month-over-month comparisons. For more information about Year-over-Year/Month-over-Month calculation configuration, see Year-over-Year/Month-over-Month.

    image

  2. Select Top3 as the calculation method for Advanced Calculation 2, complete the related configuration, and click OK.

    TopN (Quick Filter) filters the results returned from the database based on numerical values. For more information about TopN configuration, see TopN.

    image

  3. Set the date filter value to 2016-07 in the date query control, and click Query. The chart displays the top 3 areas by Order amount in July 2015. image