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

Bucket using a count of a sum

This should be easy, but can't wrap my mind around it

Have four users

LOAD * INLINE [

    User, SCORE

    1, 3

    2, 4

    1, 4

    3, 1

    4, 1

    5, 1

];

Would like how many users have a 1 for the score etc.. so would be like

NumUsers       Score

3                      1

1                      4

1                      7

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

gotcha, so the dimension becomes a 'calculated dimension' with the following formula:

=aggr(sum(SCORE),User)

View solution in original post

5 Replies
JonnyPoole
Employee
Employee

I loaded the data but got a different result.

Score is the dimension and count(distinct user) is the expression.  I validated the results with the list of users that fall into each category .

What am i doing wrong ?

Capture.PNG.png

mellerbeck
Creator II
Creator II
Author

user 1 has two scores, a value of 3 and a value of 4 so the score would be 7. Sorry didn't explain that very well in the initial question.

So, want the count of how many users have a score of X, and the 'score' is the sum of the scores. 

JonnyPoole
Employee
Employee

gotcha, so the dimension becomes a 'calculated dimension' with the following formula:

=aggr(sum(SCORE),User)

JonnyPoole
Employee
Employee

Capture.PNG.png

mellerbeck
Creator II
Creator II
Author

Yes! Gah it looks like case sensitivity was hurting me

I had =aggr(sum(SCORE),user)


with a lowercase u for user!