Cumulative sum over ROW in Dynamic Cross Table (QlikSense)

65 Views Asked by At

I have a measure "Sales" by "month":

month Sales
01-2023 10
02-2023 20
03-2023 15
04-2023 30
05-2023 13

and I need the cumulative sum presented in a Dynamic cross table :

month 01-2023 02-2023 03-2023 04-2023 05-2023
Sales 10 30 45 75 88

I tried using

RangeSum(Above(TOTAL Sum(Sales), 0, RowNO(TOTAL)))

It works for normal tables (by column) but when I use it in a dynamic cross table (by row), I get:

month 01-2023 02-2023 03-2023 04-2023 05-2023
Sales 0 0 0 0 0

I've also seen solutions involving changing the script but it would almost double the size of my app.

1

There are 1 best solutions below

0
Stefan Stoichev On BEST ANSWER

Since you are transposing the month dimension then the values are becoming columns.

The expression should be changed to respect that:

  • Above is now Before
  • RowNo is now ColumnNo

The full expression will be:

Rangesum(Before(Sum(Sales),0,ColumnNo()))

And the result table is:

Result table