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: 
rogeriobarbosa
Contributor II
Contributor II

I need a function returns zero if the number of negative

I need a function returns zero if the number of negative.

EX: -25 = 0

       30=30

     -35=0

Thank you

5 Replies
anbu1984
Master III
Master III

=If(Field > 0,Field,0)

rogeriobarbosa
Contributor II
Contributor II
Author

Hello Thanks for the reply , but do not want to use one if I would like a function to do that

simondachstr
Specialist III
Specialist III

(fabs(Field)+Field)/2

rubenmarin

rangemax(0, Field)

Not applicable

Maybe you could use the fabs function:

=(fabs(X)+X)/2

This way you get 0/2 if negative and 2X/2=X if positive.