Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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
MVP
MVP

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