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

Totals on complex formulas in pivot table

Hi,

we have a problem to calculate correct totals in pivot table. It works fine for simple sum() statement but when it comes to complex calculation it displays (-).

First we had an complex If then construct - sums wasn't working.

e.g.:

if (dimension = 'X', sum(sqrt(Value), sum(sqrt(Value) - Value))

Second we developed a methode to sum the different sums an mulitply each with a factor of 0 or 1.

(sum(sqrt(Value))* Factor1) + (sum(sqrt(Value) - Value) * Factor2)

Anyhow we can not calculate the correct totals. i have read about the arrg() function, but surrounding this expression doesnt worked. Any Ideas?

Greeds Boris

1 Solution

Accepted Solutions
prieper
Master II
Master II

Hi Boris,
in an expression you should use the IF within the Aggregation-function, like:

SUM(IF(dimension = 'X', SQRT(Value), SQRT(Value) - Value))

HTH
Peter

View solution in original post

2 Replies
prieper
Master II
Master II

Hi Boris,
in an expression you should use the IF within the Aggregation-function, like:

SUM(IF(dimension = 'X', SQRT(Value), SQRT(Value) - Value))

HTH
Peter

Not applicable
Author

Ok i will give it a try