Horizontal Proportion of Cross Tables

  • Last update:  2023-10-20
  • Overview

    Preview

    This document introduces how to calculate the horizontal proportion of cross tables.

    You may need to calculate the sales proportion of each product category in each province. For example, in Shanghai, the sales of fresh food accounts for 7.06% of the total.

    1.png

    Implementation Method

    Calculate the total sales of each province and the provincial sales of each product category through the DEF function.

    The formula is as follows: Proportion = Provincial sales of each product category / Provincial sales.

    Procedures

    Sample data: Group Sales Table.xlsx

    Adding Data

    Create an analysis subject and upload the sample data Group Sales Table.

    2.png

    Calculating the Horizontal Proportion

    1. Go to the component editing page and select the chart type as Cross Table. Drag the Province field into Row Dimension and the Product Category field into Column Dimension.

    3.png

    2. Calculate the total sales of each province. Add a calculation indicator and enter the formula shown in the following figure.

    4.png

    Formula
    ExplanationReference

    SUM_AGG(Sales)

    Sums up the total sales amount.

    SUM_AGG

    DEF(SUM_AGG(Sales Amount),[Province])

    Groups data by province and sums up the sales amount of each group to calculate the total sales of each province.

    DEF (Specified Dimension)

    3. Calculate the provincial sales amount of each product category. Add a calculation indicator and enter the formula shown in the following figure.

    5.png

    Formula
    ExplanationReference

    SUM_AGG(Sales)

    Sums up the total sales amount.

    SUM_AGG

    DEF(SUM_AGG(Sales Amount),[Province,Product Category])

    Groups data by province and product category and sums up the sales amount of each group to calculate the provincial sales of each product category.

    DEF (Specified Dimension)

    4. Calculate the proportion. Add a calculation indicator and enter the formula shown in the following figure.

    6.png

    5. Drag the Proportion of the Sales Amount of Each Product Category field into the analysis area and change the Value Format to Percentage.

    7.png

    Demonstration

    See section "Preview."

    附件列表


    主题: Creating a Visual Component
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy