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

Help with averages

Sum(UNITS)/count(distinct(PACKAGE_ID))/sum(total units)/count(total distinct(PACKAGE_ID))

I am attempting to calculate an individiual sales reps average units per sale against teh business' overall average units per sale. This is the expression I wrote but delivers a - for all reps.

sum(units)/count(distinct(package_ID) is 100% accuare to calculate each reps personal.

Now I am trying to figure out how much percentage difference between their average units per sale vs the business as a whole(all reps).

any ideas?

Thanks in advance as always!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

turns out that was indeed the problem, qlik validated the expression with ok but in fact did not recognize the units as UNITS.

Thanks for pointing it out.

solved.

View solution in original post

5 Replies
CarlosAMonroy
Creator III
Creator III

Hi Kenneth,

I guess you are missing some brackets also.

Try this:

(Sum(UNITS)/count(distinct PACKAGE_ID)) / (sum(total UNITS)/count(total distinct PACKAGE_ID))


Hope that helps.

Carlos M

Anonymous
Not applicable
Author

Thank you.

It's the exact same result. I just get the -

m_woolf
Master II
Master II

I notice that in the first part of your expression, UNITS is all caps. In the last part it is lower case. Are these two different fields?

Anonymous
Not applicable
Author

same field, sorry about the caps

Anonymous
Not applicable
Author

turns out that was indeed the problem, qlik validated the expression with ok but in fact did not recognize the units as UNITS.

Thanks for pointing it out.

solved.