Calculate the annual year-on-year cumulative amount

  • Last update:  2022-04-08
  • 1. Overview

    1.1 Expected effect

    1.png

    1.2 Implementation ideas

    Use the quick calculation functions ACC_SUM-cumulative and SAME_PERIOD-same period to calculate the accumulated amount of the current year and the accumulated amount of the same period last year;

    Since it is necessary to aggregate the cumulative amount annually and calculate the cumulative monthly amount in the same year at the same time, it is necessary to drag in the "SIGNDATE" grouped by "Year" and "SIGNDATE" grouped by "Year Month" at the same time.

    2. Operation steps

    Sample data: "SalesDEMO>FRDemo_ORDERS".

    2.1 Create component

    Select "FRDemo_ORDERS" under "Data Preparation", and create a component, as shown in the figure below:

    2.png

    2.2 Calculate the monthly cumulative amount of the current year

    Click "+" to create the calculation indicator, name it and enter the formula: ACC_SUM(SUM_AGG(AMOUNT),1), click "OK", as shown in the figure below:

    3.png

    Note: The functions and fields in the formula box need to be selected by clicking the selection area on the left, and cannot be entered manually.

    Formula description:

    FormulaDescription
    SUM_AGG(AMOUNT)Group summation of the 'AMOUNT" by dimension.
    ACC_SUM(SUM_AGG(AMOUNT),1)Cumulative summation of the 'AMOUNT" by dimension.

    2.3 Calculate the monthly cumulative amount of the same period last year

    Click "+" to create the calculation field, name it and enter the formula: ACC_SUM(SAME_PERIOD(SUM_AGG(AMOUNT),"Y"),1), click "OK", as shown below:

    4.png

    Formula description:

    FormulaDescription
    SAME_PERIOD(SUM_AGG(AMOUNT),"Y")Calculate the group summation of the "AMOUNT" in the same month of last year by dimension.
    ACC_SUM(SAME_PERIOD(SUM_AGG(AMOUNT),"Y"),1)Calculate the accumulative summation of the "AMOUNT" in the same month of last year.

    2.4 Year-on-year calculation

    Add a calculation field, name and enter the formula: cumulative amount of the current year/ cumulative amount of last year, click "OK", as shown in the figure below:

    5.png

    2.5 Create a group table

    Drag the "SIGNDATE" field twice into the dimension column, and then set the grouping basis to "Year" and "Year Month" respectively, as shown in the following figure:

    6.png

    7.png

    Note: The reason for using the "Year" and "SIGNDATE" fields is that when calculating the current year's cumulative amount and last year's cumulative amount, if the calculation is based only on the "year month" basis, the cumulative amount will continue to accumulate data for all years. The result is not to calculate the cumulative value in different years.


    Drag three indicators into the indicator column and select "Group Table", as shown in the figure below:

    8.png

    At the same time, the unnecessary time data can be filtered, as shown in the following figure:

    9.png

    2.6 Effect view

    2.6.1 PC

    See section 1.1 of this article for details.

    2.6.2 Mobile

    10.png


    附件列表


    主题: Advanced Data Analysis
    Previous
    Next
    • 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