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.
Sample data: "SalesDEMO>FRDemo_ORDERS".
Select "FRDemo_ORDERS" under "Data Preparation", and create a component, as shown in the figure below:
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:
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:
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:
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:
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:
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:
At the same time, the unnecessary time data can be filtered, as shown in the following figure:
See section 1.1 of this article for details.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy