Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

kennethholden
Contributor

[1}

Sum(UNITS)/count({1}total distinct(WEEK))

This does not return the correct answer. Essentually I have 33 weeks of the fiscal year so far and for this sales representative she has only written busines in abot 20, so qkiksense is ging me her average per week based only on the weeks she rote business, infalting her true average per week which is divided by all weeks.

I attemped to to put the {1) in here to tell qlik to include all totoal distinct weeks YTD and it gives a me weird and wrong number

Your help apprecaited.

32 Replies
thiago_justen
Valued Contributor III

Re: [1}

Maybe this:

Sum(UNITS)/count(all distinct WEEK)

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
kennethholden
Contributor

Re: [1}

sorry no, tried all, total, your format above, all wrong numbers as answer which I validate manually to ensure.

kennethholden
Contributor

Re: [1}

what is interesting is that my formual works in a table, but not in a KPI onbject. Exact same formula.

MVP
MVP

Re: [1}

Would you be able to share a sample or an image to show it working in table, but not in KPI?

kennethholden
Contributor

Re: [1}

Screenshot of Google Chrome (2018-06-18, 7-18-48 PM).png

kennethholden
Contributor

Re: [1}

look at "webber" then look at 2018 av/wk is 25.956

here it is in the KPI object, exact same expression:  sum(units)/count(total distinct(week))

kennethholden
Contributor

Re: [1}

Screenshot of Google Chrome (2018-06-18, 7-20-57 PM).png

kennethholden
Contributor

Re: [1}

here it is 36 becasue it is dividingby her total number of weeks biut not by the actual number of weeks, I thought "total" would do that.

kennethholden
Contributor

Re: [1}

look at webber and avunits/wk

Community Browser