Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
djbloiss
Contributor III
Contributor III

Test if null in Expression

I am passing Variables to my expression and I want to test if the value is null, so I can do something different depending on if it is Null or not.  How can I test if the variable is null?  This is currently what I am testing:

if(IsNull('$1'),'Null','Not Null')

then I am calling it like this:

$(Testing($(Test)))

or this:

$(Testing)

In either case it is returning Not Null. 

8 Replies
marcus_sommer

Try it with: if(len(trim('$1'))=0,'Null','Not Null')

- Marcus

Anil_Babu_Samineni

What does the $1 parameter contains?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
djbloiss
Contributor III
Contributor III
Author

I tell you in the original question

djbloiss
Contributor III
Contributor III
Author

It did the same thing.

I even tried if(IsNull(trim('$1')),'Null','Not Null')

still the same result

marcus_sommer

Please provide some more details what do you want to do. I assume that you want to nest parametrized variables. This is in general possible but not trivial from a syntax point of view:

- Marcus

djbloiss
Contributor III
Contributor III
Author

Marcus, I don't want the full answer because I am new and I am trying to figure things out on my own.  Getting the full answer will not help me much.

Anil_Babu_Samineni

Can you post image of your parameters?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
djbloiss
Contributor III
Contributor III
Author

I have it figured out and am going to do a full Blog Post as this took a lot of research.