Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
kennethholden
Creator
Creator

[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
Specialist III
Specialist III

Maybe this:

Sum(UNITS)/count(all distinct WEEK)

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

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

kennethholden
Creator
Creator
Author

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

sunny_talwar

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

kennethholden
Creator
Creator
Author

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

kennethholden
Creator
Creator
Author

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
Creator
Creator
Author

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

kennethholden
Creator
Creator
Author

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
Creator
Creator
Author

look at webber and avunits/wk