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

what about

=Sum( [profit] )

as Total $ column expression ?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

View solution in original post

6 Replies
agigliotti
MVP
MVP

what about

=Sum( [profit] )

as Total $ column expression ?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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
MVP
MVP

which dimensions do you have in your table object?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
josephz94
Contributor
Contributor
Author

State everything else was measures

agigliotti
MVP
MVP

could you post a print screen with your actual result?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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!