I wish to derive cumulative column based on initially adding the daily amount to the Value, then subsequently adding the daily amount to the resulting figure.
Could you please help, thanks.
| Date | Type | Value | Rate | Cummulative |
|---|---|---|---|---|
| 29/04/2022 | A | 128.61 | 32.00 | 256.61 |
| 28/04/2022 | A | 128.61 | 32.00 | 224.61 |
| 27/04/2022 | A | 128.61 | 32.00 | 192.61 |
| 26/04/2022 | A | 128.61 | 32.00 | 160.61 |
Have a look at the example script below. Once reloaded the
CumulativeDatatable will contain new columnCumulativewhich will be the result.The "magic" is happening in the following expression:
In the expression we are saying:
ValueandRatevalues. This is our "base" and we'll accumulate to this valueCumulativecolumn (peek(Cumulative)) and add the current rowRatevalueMore about
peekfunction can be found at the documentation pageExample script:
Result table: