Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sum across rows in a pivot table (running total)

Hi All

I have a pivot table with monthly total across 12 months in a pivot table

I have tried using  the function RangeSum(sum(total), before(sum(total))) to create a running total YTD total but it is not consistent

Is there another function that will allow me to create a running total

e.g 

             Jan   feb    Mar   Apr

AP          10   20     30    40

AP YTD   10  30     60    100

Cheers

Brett

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression and please find attached file for solution.

=RangeSum(Alt(Before([AP YTD]), 0), Sum(AP))

Regards,

Jagan.

View solution in original post

6 Replies
MayilVahanan

Hi

Try like this

Calculating rolling n-period totals, averages or other aggregations

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression and please find attached file for solution.

=RangeSum(Alt(Before([AP YTD]), 0), Sum(AP))

Regards,

Jagan.

Not applicable
Author

Thanks Jagan

I am finally understanding how Pivot  tables work , Cheers Brett

Not applicable
Author

Thanks Jagan

I am finally understanding how Pivot  tables work , Cheers Brett

Not applicable
Author

Is it also possible to perform a %YTD calculation in a line chart given the same scenario. I have tried using accumulation using sum(AP)/sum(TP) but do not get the correct result

e.g

                 Jan   feb    Mar   Apr

AP              10   20     30    40

AP YTD       10  30     60    100

TP YTD        15  35    65    110

Not applicable
Author

Hi Jagan,

Thanks a lot lot lot..............

Regards,

Sagar Gupta