For example, given the daily number of stocks bought and sold, it is necessary to count the cumulative number of remaining stocks each month, as shown in the following figure:
Use the ACC_SUM function.
The first parameter is the indicator calculated by the user, which must be an aggregate function or aggregate indicator.
The second parameter range is the calculation range set by the user, 0 is to accumulate all rows, and 1 is to accumulate all rows in the group.
stock trading data.xlsx
Knowing the daily number of stocks bought and sold, it is necessary to count the number of remaining stocks each month.
Drag "Date" into the dimension column and set it to the "Year Month" format, and drag "Buy" and "Sell" into the indicator column, as shown in the following figure:
Add a calculation indicator and name it "Cumulative remaining stocks", enter the formula: ACC_SUM(SUM_AGG(buy-sell),0), click "OK", as shown in the figure below:
Formula description:
You can see that the cumulative value of "2016-01" equals to "-469+2562=2093", as shown in the figure below:
For the writing of functions, please refer to: Function Calculation Format.
See section 1.2 of this article for details.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy