July
February 13, 2025, 9:14pm
1
Hi guys,
I need to calculate the accumulated number of customers over the last 90 days as a window in time.
I tried using “runningSum” and “periodToDateSum” but it didn’t work.
periodToDateSum({qty_customers}, {my_date} , ‘MONTH’, 3)
runningSum(
sum({qty_customers}), [{my_date } ASC])
The “runningSum” accumulates all dates, but I need a date to accumulate the number of customers up to 90 days ago, do this for all days.
Example:
Date | Qty | runningSum_90days
20250201 | 100 | xxx → this needs to accumulate the number of customers 90 days backwards from this date
20250202 | 200 | xxx → this needs to accumulate the number of customers 90 days backwards from this date
…
I tested it with “windowSum”, but it has been increasing since the beginning of the year and the correct is to sum 90 days ago
windowSum(sum({qty_customers}), [my_date ASC], 90, 0)
duncan
February 14, 2025, 8:32pm
2
Hello @July !
To make sure I understand what you want, according to your screenshot, you would expect to see 3,409 rather than 23,633?
Have you tried the solution outlined here:
Hi,
What are the possible ways to get the running total for last n months.
Im currently using windowsum but if i apply a date filter the result is incorrect.
windowSum(sum({volume}),[{period} ASC],3,0)-{Total Volume}
result: the figures are correct in this screenshot
[image]
But if i apply a date filter. the result is incorrect. In screenshot below, i filtered to start on March 2023.
[image]
Thanks
July
February 14, 2025, 9:41pm
3
Exacty! I want to see 3.409
duncan
February 18, 2025, 2:50pm
4
Hey @July ,
Were you able to try the solution from the topic I linked above?
1 Like
July
February 18, 2025, 4:49pm
5
Hi @duncan
No, unfortunately, I resolve this directly my dataset
Tks!
1 Like