Overview
Application Scenario
You may need to perform calculations (such as Sum, Average, Maximum, and Minimum) in chart or table components.
For example, you may need to calculate the total sales of all regions, as shown in the following figure.
Function Description
You can use the All Values function or the All Values in Group function in Quick Calculation.
All Values
Concept
The function is to calculate all values of the indicator, including sum, average, maximum, and minimum values. If you use the function to calculate all values, the values displayed in all dimensions of the indicator will be the same, which is the result of the calculation.
For example, you may want to display the total sales of all regions, as shown in the following figure.
Calculation of All Values
1. Use Store Sales Data to create a group table, as shown in the following figure.
2. Click the icon of the Sales field and choose Quick Calculation > All Values > Sum.
All Values in Group
Concept
The function is to calculate all values of the indicator in the group, including sum, average, maximum, and minimum values. If you use the function to calculate all values in the group, the indicator's values displayed in the group will be the same, which is the result of the calculation of all the data in the group.
For example, you may want to display the total sales of all regions and hope to expand the group table to display the total sales of each region, as shown in the following figure.
Calculation of All Values in Group
1. Use Store Sales Data to create a group table, as shown in the following figure.
2. Click the icon of the Sales field and choose Quick Calculation > All Values in Group > Sum, as shown in the following figure.
Functions Used to Calculate All Values
Sum: TOTAL(SUM_AGG(Sales),0,"sum")
Average: TOTAL(AVG_AGG(Sales),1,"avg")
Maximum: TOTAL(MAX_AGG(Sales),1,"max")
Minimum: TOTAL(MIN_AGG(Sales),1,"min")
For details about how to use the TOTAL function, See TOTAL.