Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

kennethholden
Contributor

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
kennethholden
Contributor

Re: Wrong Average

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.

3 Replies
kennethholden
Contributor

Re: Wrong Average

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

kennethholden
Contributor

Re: Wrong Average

sorry that was wrong, had filtered data

kennethholden
Contributor

Re: Wrong Average

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.

Community Browser