Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot Table Expression not totaling correctly

The pivot tabel has dimensions of Year and Period. The total does not add up to the amounts within each period. This is an example of the the experssion I am using If([PERNUM]>=(CURPER), Sum (CurFstDol),Sum (CURAMT)) . If I change the format to a straight table the total is correct. What am I missing?

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

At the year level, your IF condition cannot be resolved properly, because there are multiple months [PERNUM] within the year.

Quick and dirty fix is to move your IF condition within the SUM (the expression becomes "heavier" in terms of memory use):

Sum (If([PERNUM]>=(CURPER), CurFstDol, CURAMT)

If you don't experience any performance slowdown, this would be enough. Otherwise, you might consider using flags (see my Wiki page about it) or Set Analysis.

regards,

Oleg

Not applicable
Author

Oleg - The Quick and dirity fix works great. To improve preformance I will also check out your Wiki page and Set analysis. Thanks for the help