Cumulative Sum "If" in Question Editor

Any way to achieve a rolling sum if in the question editor? Able to write this in SQL without issue, but my client would like to be able to put this together themselves.

Using the example here: Time series comparisons

Instead of totals by month of year we'd like to display rolling sums of the total by year month with one year in the first column and another year in the second. Have tried this but just throws an error:

CumulativeSum(SumIf([Total → Amount], between([Created On], "2021-01-01", "2021-12-31")))

Any help appreciated!

Hi @pjatx1
Something like this?

CumulativeSum(case(between([Created On], "2021-01-01", "2021-12-31"), [Total → Amount]))
1 Like

Thanks @flamber! Works like a charm :pray: