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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Adding IsNull to If Statement to Expression

Hi,

I'm struggling to find the right syntax in adding a if(IsNull to an existing expression:  Here is the existing expression:

if([Salespercent]<.90, 0,

if([Salespercent]>=.90 and [Salespercent] <=.957, 2,

if([Salespercent]>=.958, 3

)))

I need to add an IsNull to the expression so if the [SalesPercentField] is Null it returns 0

Can someone please help?  Thank you.

Brian

Labels (1)
3 Replies
Not applicable
Author

Hi Brian,

you can just put the 0 into you final else condition, which will catch any null as they will fall out of all of your prior true statements.

if([Salespercent]<.90, 0,

if([Salespercent]>=.90 and [Salespercent] <=.957, 2,

if([Salespercent]>=.958, 3,0

)))

hope that helps

Joe

Not applicable
Author

Thanks!

Colin-Albert
Partner - Champion
Partner - Champion

You can test if the field length is zero

If( len( [SalesPercentField] ) > 0, 'Field is not null', 'Field is null')