Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Brysonds
Contributor III
Contributor III

Aggr average not rolling up as expected in pivot table

Hello,

I have a pivot table with several dimensions, and am trying to display the average at each level of the dimension below. I am trying to avoid using any hard-coded expression based on dimensionality() or getobjectfield() since there are several dimensions and they may be moved around for analysis.

Simplified example and expected output:

Brysonds_1-1651071468832.png


This is the formula I am using:

Avg(Aggr(Sum([Measure]),[Customer Group],[Customer],[Employee],[Product]))

Interestingly enough, if I add a second measure of Avg(Measure), this gives the exact same output as the aggr version above, so I assume there is a problem with my expression.

Labels (1)
1 Reply
vinieme12
Champion III
Champion III

don't use Avg() at all, calculate the average  as sum() / count()

example, Average sales per transaction

sum(Sales)/Count(Transaction)     

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.