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: 
Not applicable

Counting a value where value is a positive/negative number

Hey Guys,

Wondering if anyone can help. I am trying to create an expression if possible that is a sum of a field in my table loaded. But if possible i only want to count 1 in the value in the table is positive. I have both positive and negative numbers in my table.

I thought it might be as simple as:

if(num1 > 0,NumericCount(num1),0)

Any help is much appreciated, Thanks.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

sum(if(Field>0,1,0))

View solution in original post

4 Replies
wallinpeter
Contributor III
Contributor III

I would create new field in script.

Add to new column to table....

if (value>0,1,value) as NewValue

create expression....

sum(NewValue)

Anonymous
Not applicable
Author

sum(if(Field>0,1,0))

fred_s
Partner - Creator III
Partner - Creator III

Hi David,

Maybe this one?

See attachment

Not applicable
Author

got it guys thanks.

sum(if(ARR_DELAY>0,1,0))