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: 
pnn44794
Partner - Specialist
Partner - Specialist

How do I exclude negative numbers from summing?

Hello:

 

I need to exclude negative numbers from summing.  My struggle is finding and using the right syntax.

 

Any and all help is appreciated.  Thanks in advance.

 

21 Replies
pnn44794
Partner - Specialist
Partner - Specialist
Author

Hello Sunny:

I get the same result with your RangeMax option as I did with Stefan's and I get the same result using the if option.  The gauge pegs out at 150% which is not correct.  It should be 73.5%.  I also have the red wiggly lines.

swuehl
MVP
MVP

As Sunny pointed out, you should have used RangeMax() [like in your original approach] instead of RangeSum() as I 've written - but this should not cause the issue you are experiencing.

Would it be possible that you upload a small sample QVW to look at?

sunny_talwar

What number you get when you try this in a text box object?

Sum({$<[Save Initiative Category] = {Server\Storage}>} RangeMax([Finance Confirmed 2016 Savings], 0))

Is the number larger that 59,500,000?

pnn44794
Partner - Specialist
Partner - Specialist
Author

Ok.

sunny_talwar

Red wiggly line is definitely a concern for me. I can't seem to find a reason for why it would continue to show up. Would you be able to share a sample just like Stefan mentioned? Or if not, can you share a screenshot of expression editor where you use your original expression

Sum({$ <[Save Initiative Category]={Server\Storage}>} [Finance Confirmed 2016 Savings]) / 59500000

I am curious to see why this one doesn't show a wiggly red line under the Save Initiative Category.

pnn44794
Partner - Specialist
Partner - Specialist
Author

Hold on.  Please ignore those numbers.  There was a filter set that I missed.

sunny_talwar

So then its working now?

pnn44794
Partner - Specialist
Partner - Specialist
Author

No, it is still not working.

sunny_talwar

It seems that there are two spaces between Initiative and Category and your other expressions only had one space between them. Can you add another space for the other expressions you have been trying out?

pnn44794
Partner - Specialist
Partner - Specialist
Author

Holy Cow!!!!  That's it.  I added the extra space and used your RangeMax solution.  It works now.  I don't know how I missed that extra space but I did.  Guess I've been looking at it too long.    Thank you very much.  I'll mark your answer as correct and give an assist to everyone else...............and talk to the owner's of the spreadsheet this data is loaded from about getting rid of that extra space.