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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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
sunny_talwar

Anytime you see a red wiggly line underneath a field name, you got to be cautious. Best thing to do is to remove the field name and then start typing its name and QlikView's script editor will start giving you the field name. Once you see your field name click enter and you should get the field name typed out for you. This way you won't have any issues related to mistyping a field name.

HTH

Best,

Sunny

swuehl
MVP
MVP

Glad you got it correct!

Though it's strange you got your correct numbers with a wrong set expression filter (even though the numbers differed from the requested result in your OP)...

Instead of using a per row comparison in the chart expression, you can also create a flag in the script to filter the positive amount values.

LOAD

     If( [Finance Confirmed 2016 Savings] >0, 1,0) as PositiveSavingsFlag,

     ...

Sum({<... ,PositiveSavingsFlag = {1} >} ...)

This should perform better on large data volume.