Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
josephz94
Contributor
Contributor

Sum each category

I feel like this has been posted before but they are always a little different and I can't seem to get the solution to work.

My data includes: company names, city, state, and profit. I am trying to create a table that has every state as a row and has the total number of companies and profit in that state. I thought the solution would be: State as a dimension then add a measure, Sum({<company_state>} [profit]) but this only gives me the sum of all of the profits on the entire list (so every row has the same answer). I tried adding TOTAL, no change. 

ex.

If, VA has 2 companies with 10k each and NC has 5 stores 20k each

then,

VA | 2 | 20k

NC | 5| 100k

 

Labels (1)
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

what about

=Sum( [profit] )

as Total $ column expression ?

View solution in original post

6 Replies
agigliotti
Partner - Champion
Partner - Champion

what about

=Sum( [profit] )

as Total $ column expression ?

josephz94
Contributor
Contributor
Author

Nope, that was my first thought before I tried the <>. It also just sums all of the profits for all of the companies/states
agigliotti
Partner - Champion
Partner - Champion

which dimensions do you have in your table object?

josephz94
Contributor
Contributor
Author

State everything else was measures

agigliotti
Partner - Champion
Partner - Champion

could you post a print screen with your actual result?

josephz94
Contributor
Contributor
Author

It ended up being an issue with my data. The information I was using was from two different tables which were linked correctly but i think some holes in the data was causing the problems. I was able to do the kind of thing I was trying to do with a different data set. Thanks for your help!