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

Use a different value for Null Statement

Hello Everyone,

In my script, I am using the following if Statment, and it works fine. What I am struggling is with when there is a null value.

if(Category = 'Maintenance', "Description of Damage") No issue at all.

However, if Category = 'Maintenance' has a null value I want to use "Describe the incident" as a then statement. 

This is the function I tried to used and it not working

if(IsNull(Category = 'Maintenance'), "Describe the incident",  "Description of Damage"))

Please let me know what I am doing wrong.

Thanks in advance. 

 

4 Replies
brunobertels
Master
Master

may be this :

 

if(IsNull(Category), "Describe the incident",  if(Category = 'Maintenance', "Description of Damage"))

has3240
Contributor II
Contributor II
Author

Hey Bruno,

Thanks for your prompt reply. I tried and it's not working. 

brunobertels
Master
Master

Hi 

when you write " Category = 'Maintenance' has a null value" do you mean the cell is blank ? 

 

may be 

if(len(trim(Category))=0,'Describe the incident', if(Category = 'Maintenance','Description of Damage'))

regards 

has3240
Contributor II
Contributor II
Author

when you write " Category = 'Maintenance' has a null value" do you mean the cell is blank?. No just some of the value is blank. In all the blank values thats where I want to use "Describe the incident"