Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
zlong1
Contributor
Contributor

AVG with missing month

 

Hi

Please take a look at the following pic. Because there is no data in JUNE, the average line 1059 is only calculated based on 9 months, like (sum from JAN to OCT / 9). 

The correct outcome should be 953 which is (sum from JAN to OCT / 10). 

Because the monthyear dimension is necessary,  is there any way that I can get correct average value in this single chart?

Capture.JPG

 
4 Replies
Gopi_E
Creator II
Creator II

try to check supressed values are hidden
zlong1
Contributor
Contributor
Author

I didn't supress any value. There is no order in JUNE. So when I generate the chart, there is no JUNE bar. But when I calculate the average, I need the sum of ten months / 10. However, the QV calculate like sum of 10 months / 9 because of no data in JUNE. 

Brett_Bleess
Former Employee
Former Employee

Zilong, have a look at the following Design Blog link, I think it may help you get things resolved:

https://community.qlik.com/t5/Qlik-Design-Blog/Average-Which-average/ba-p/1466654

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Maybe you should try instead of using qlik native average function:

sum(<Data>)/count(distinct Month)

Be sure you have a master calendar designed in your data model.