Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue with count formula

Dear colleagues,

I am trying to achieve allocation of total territory's sales among of representatives that are covering it. For example, I have 3 representatives A1, A2, A2 on a terriotry A and sales are equal to 10. If I just drop position as dimension, I get total territory sales across each position:

1.jpg

To fix that, I want to count number of positions covering this territory and divide total territory sales by number of positions. For that I tried below formula: =max(aggr(Count(DISTINCT Position),District, Month)), it works well only for the first position, the remaining positions are supressed:

2.jpg

Could you please help to understand why I am not able to achieve the desired result?

Many thanks in advance.

P.S. I am also attaching QV sample file.

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Or maybe

=Sum(TOTAL<District,Month> aggr(1 ,District, Month,Position))

View solution in original post

4 Replies
Not applicable
Author

try this

sum(TOTAL aggr(Count(DISTINCT Position),District, Month, Position))

swuehl
Champion III
Champion III

Or maybe

=Sum(TOTAL<District,Month> aggr(1 ,District, Month,Position))

Not applicable
Author

Thanks a lot, that was quick!

Not applicable
Author

How are you not an MVP stefan