
Re: Total SUM
JeanLuc Pache Sep 25, 2013 12:07 PM (in response to Ciro Petrullo)Qlikview give the correct answer: 19/25=76%.(sum(v3)/sum(v1))
In statistic you cannot calculate the average of percentages.

Re: Total SUM
Ciro Petrullo Sep 25, 2013 12:13 PM (in response to JeanLuc Pache)thanks for the reply.
I know it's a correct answer, but there is a way to get the result by adding a field without using before?

Re: Total SUM
Oleg Troyansky Sep 25, 2013 4:06 PM (in response to Ciro Petrullo)If I understand you correctly, QlikView calculates the "Expression Total" at your subtotal levels and you'd like to calculate the average of the subtotals instead...
You can use Advanced Aggregation (funciton AGGR) to precalculate the subtotals at the relevant level of detail, and then to apply average to the precalculated results: something like this:
AVG( AGGR ( sum(V3)/SUM(V1), D1, D2) )
Usually the same expression should work equally well for all levels. If it doesn't, then you can use Dimensionality() to define what calculation to use at what level:
IF (Dimensionality() = 0, <Formula1>, <Formula2>)
cheers,
Oleg Troyansky

