Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

IF and IsNull function

I'm trying to add an IF-function in the script:

IF (IsNull () and IsNull (), "Yes", "No")

The script says that the formula is okay, but it doesn't show the desired result.

Who can help me to discover the error in my formula?

13 Replies
m_woolf
Master II
Master II

You need single quotes:


IF (IsNull () and IsNull (), 'Yes', 'No') as SomeFieldName

Anonymous
Not applicable
Author

I have tried it with single quotes, but still not the desired result.

atoz1158
Creator II
Creator II

Hi

Please state what you are expecting.

The way I read your IF statement I would expect to get the following.

   

ABResult
A ValueA N ValueNo
A ValueNULLNo
NULLA N ValueNo
NULLNULLYes

Is this what you are getting?

If you are expecting to get Yes when either A or B is NULL then you need to change your AND to an OR

Adrian

Anil_Babu_Samineni

May be try this?

IF (IsNull (), If( IsNull (), "Yes", "No"))


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
m_woolf
Master II
Master II

What are your desired results?

Anonymous
Not applicable
Author

It doesn't work unfortunately.

But thanks for the help.

Anonymous
Not applicable
Author

This is exactly where I'm looking for.

But by using my formula it gives:

ABResult
A ValueA ValueNo
A ValueNULLNo
NULLA ValueYes - should be No
NULLNULLYes
m_woolf
Master II
Master II

Logic is OK.

Can you post a sample qvw showing the problem?

vishsaggi
Champion III
Champion III

May be try using

IF( Len(Trim()) = 0 AND Len(Trim()) = 0, 'Yes', 'No')