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

Make 0 (zero) when value is negative

Hi,

I'm looking for a clean formually which turns any value to 0 when the original value goes below 0.

I'm having a dashboard based on a log, and I need to do calculations in the front end (unfortunately) to come to a certain number. Sometimes, when selecting certain dimensions, I'm getting negative values which make sense according to the formula, but can't occur in the real world (eg: -3 registrations).


I could of course work with an if like this:

if(value <= 0, 0, value)

... but I wanted to know if their might be a cleaner way to do this as my "value" in the script above is actually a pretty large formula)

Kind regards,

Christophe

Ps: The value is shown in a text object in my dashboard

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

I think this will helps you,

Rangemax(Value,0)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Christophe,

how about max(0, value)?

Marcus

MayilVahanan

Hi

Try like this

I think this will helps you,

Rangemax(Value,0)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

Wow, thanks for the fast reponses !!

Rangemax did the trick.. !