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

How to write if statement with not NULL ?


Hello,

I have a field , from a SQL database that I would like to IF against :

If (fieldname NOT NULL, do this )

How would  I write this like above, but correctly ?

1 Solution

Accepted Solutions
ychaitanya
Creator III
Creator III

if( isNull('Fieldname'),'null conditon','not null conditon');

This will work..

Thanks

Chaitanya

View solution in original post

6 Replies
ychaitanya
Creator III
Creator III

if( isNull('Fieldname'),'null conditon','not null conditon');

This will work..

Thanks

Chaitanya

sushil353
Master II
Master II

Hi,

try below code:

If(not isnull(filedname) ,1,0)

HTH
Sushil

its_anandrjs
Champion III
Champion III

Try with

If( IsNull(fieldname) = 0, do this )

Or

If( Not IsNull(fieldname), do this )

Regards

Anand

amit_saini
Master III
Master III

Try this:

=if (not isnull(Plant_ShortName),Plant_ShortName & ' - ' & Plant_FullName)

Thanks,

AS

anbu1984
Master III
Master III

If (IsNull(fieldname> <> -1, 'do this' )

Not applicable
Author

Thanks , that worked perfectly !