Overview
Application Scenario
Sometimes, you may need to calculate the horizontal proportion.
When using the Group Table to create charts, you may need to calculate the Share of sales volume of Fashion hall in total sales volume and the Share of sales volume of Living Hall in total sales volume.
For example, in May 2017, the formula for the share of Living Hall is 3614113/(3614113+1840913)*100%=66.25%; the formula for the share of Fashion hall is 1840913/(3614113+1840913)*100%=33.75%.
Implementation Method
Copy the Sales Volume indicator field, perform detailed filtering with the condition Shop style In Fixed Value Fashion hall, and add a calculation indicator field.
Use the same method to calculate the share of the sales volume of Living Hall.
Procedure
Component Creation
Click New Subject and search the Store sales statistics in Public Data, as shown in the following figure.
Indicator Copying and Filtering
1. Go to the component editing page.
2. Copy the Sales field twice and name them Sales volume of Living Hall and Sales volume of Fashion hall respectively, as shown in the following figure.
3. Click the icon of the Sales volume of Living Hall field, select Filter Detail from the drop-down list, set the filter condition to Shop style In Fixed Value Living Hall, and click OK, as shown in the following figure.
4. Use the same method to perform detailed filtering for the Sales volume of Fashion hall field.
Proportion Calculation
1. Add a calculation indicator field named Share of sales volume of Living Hall in total sales volume, enter the formula: SUM_AGG(Sales volume of Living Hall)/SUM_AGG(Sales Volume), and click OK, as shown in the following figure.
2. Use the same method to add a calculation indicator named Share of sales volume of Fashion hall in total sales volume, as shown in the following figure.
3. Click the Group Table icon in Chart Type, drag the fields into the analysis area, and set the grouping basis for the Sales Date field to Year-Month, as shown in the following figure.
4. Click the icon of the Share of sales volume of Living Hall in total sales volume field, select Value Format from the drop-down list, and set the format to Percentage. Use the same method to set the format of the Share of sales volume of Fashion hall in total sales volume field to Percentage, as shown in the following figure.
Effect Display
For details, see section "Application Scenario."