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

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Arno
Contributor II
Contributor II

avg(aggr(count()) not delivering correct total average

Dear all,

I am trying to calculate the average of the used equipment per catagory over a period of time.

For this I am using the following expresession: Avg(Aggr(Count(distinct TANK),[Contract Name], Periode))

This is perfectly working on the catagory level ("Contract Name") but the total average is not correct, means showing the average of the averages per catagory instead of total average (see picture attached).

Do you see, what I am doing wrong?

Many thanks, Arno

1 Solution

Accepted Solutions
OmarBenSalem
Partner - Champion II
Partner - Champion II

Use the dimensionality function to control what to calculate in the total,

if(dimensionality()=0,'the expression of the total avg',

'ur expression')

View solution in original post

2 Replies
OmarBenSalem
Partner - Champion II
Partner - Champion II

Use the dimensionality function to control what to calculate in the total,

if(dimensionality()=0,'the expression of the total avg',

'ur expression')

Arno
Contributor II
Contributor II
Author

Many thanks. This works well, exactly what I was looking for.

Best regards