Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can you help me with a solution for the following problem?
I have the following fields (ID, date, posting_date and Value). I need to calculate the field TotalSum inside the script (the functions above/below etc are not working) as the sum from current and previous rows. I have an example below for better understanding:
ID | date | posting_date | Value | TotalSum |
46 | 7/29/2023 | 2023-07-19 | 2,000 | |
46 | 7/29/2023 | 2023-07-20 | 200 | 2,200 |
46 | 7/29/2023 | 2023-07-21 | 100 | 2,300 |
46 | 7/29/2023 | 2023-07-23 | 500 | 2,800 |
46 | 7/29/2023 | 2023-07-24 | 800 | 3,600 |
46 | 7/29/2023 | 2023-07-25 | 300 | 3,900 |
46 | 7/29/2023 | 2023-07-26 | 100 | 4,000 |
46 | 7/29/2023 | 2023-07-27 | 500 | 4,500 |
46 | 7/29/2023 | 2023-07-28 | 600 | 5,100 |
46 | 7/29/2023 | 2023-07-31 | 100 | 5,200 |
Thank you
Hello @maya_yurika
no need to do anything in the script
add a table
add for example the posting date as a dimension
use the either of the following expressions: (note in this example the total sum will be the same even if you select a posting date so add other dimensions used in the table so that result stays the same on any selection made on the dimensions used in the table)
of course do not add the value as a dimension
also in the Add Ons -> data handling uncheck the include zero values
=RangeSum(
Sum(Value),
Above(Sum({<posting_date>}[Value]))
)
*
Avg(1)
or
=RangeSum(
Above(
Sum({<posting_date>}[Value])
,0,RowNo())
) *
Avg(1)
Can you try above similar process using peek