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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
SplittFPS
Contributor II
Contributor II

Sum function on a measure

I want to use the =sum() function on a measure, such as Net sales, but it only works for field values like sales amount. Is there any way I can use it on Net sales? 

SplittFPS_0-1754470749270.pngSplittFPS_1-1754470797083.png

 

Labels (4)
1 Solution

Accepted Solutions
Or
MVP
MVP

Again, you can't sum(sum(Field)), so what you're trying to do won't work... 

View solution in original post

7 Replies
Or
MVP
MVP

Assuming the measure in question already contains an aggregation, you would not be able to use sum() on it, since you can't directly nest aggregations (e.g. you can't use sum(sum(field))).

You may be able to use aggr() if you need nested aggregation, but without any specifics, I can't begin to guess. 

SplittFPS
Contributor II
Contributor II
Author

Ok thanks. Would there still be a way to calculate the total of all the net sales in a Table? I would want a whole column with this value and not just the automated total at the end.

Or
MVP
MVP

What's the difference between "The total of net sales" and "Net sales"? 

SplittFPS
Contributor II
Contributor II
Author

in the table the net sales are shown for each product and the total are all these added up.

e.g.                   Total 

Apple    1000   3000

Banana 2000   3000

Total      3000       

and I don't want it shown at the bottom I want it as another column like I tried to show in my example

Or
MVP
MVP

Sum(Total FieldName), then. 

SplittFPS
Contributor II
Contributor II
Author

When I try this, it just says 0 for all. I think the problem here again is that Net Sales is a measure and not a field because when I try with a field value e.g. Sales amount this works 

Or
MVP
MVP

Again, you can't sum(sum(Field)), so what you're trying to do won't work...