Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Wrong Average

((max([Unit Goal]))-(sum(UNITS)))/(52-(count(distinct(WEEK))))

This expression is giving me the wrong average units per week.

currently, 38 fiscal weeks have elapsed, the rep max goal is 2000, her current number of units is 1596.2, weeks remaining is 14.

This expression should give me a result of 28.8 units /week to hit her goal, but its giving me 25.2units/week.

can anyone shed any light on this?

its in a table with rep name for first column, and then each column over is a different metric.

As always, any assistance appreciated.

thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

solved it myself 🙂

needed to add "total" to count distinct week as she only had business in 26 weeks and it was filtering based on her number vs all actual weeks remaining.

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Did some testing Qlik is doing count(distinct(week) as 36 weeks, but there is 38, I have checked my source file and there are 38 distinct weeks.

any reason why qlik would skip two weeks? this is the problem

Anonymous
Not applicable
Author

sorry that was wrong, had filtered data

Anonymous
Not applicable
Author

solved it myself 🙂

needed to add "total" to count distinct week as she only had business in 26 weeks and it was filtering based on her number vs all actual weeks remaining.