Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if(value=x,NULL,value)

If a value is = to a certain value, then I need to set it to null, otherwise, I need to set it to the value.

What I'm not sure of, is what to use to set a value to null. Is '' truly a null value, or is there a way as there is in sql to say NULL, as '' is a blank string, not a null value.

Hopefully, this makes sense and I'm just having a moment.

Thanks in advance for your assistance!

Greg

1 Solution

Accepted Solutions
marcus_sommer

You could simply use null():

if(value = 'x', null(), value)

- Marcus

View solution in original post

8 Replies
marcus_sommer

You could simply use null():

if(value = 'x', null(), value)

- Marcus

sasiparupudi1
Master III
Master III

"" is a blank string and Null() function returns the true null value. below is the help text from Qlik

Null( )

Returns a real NULL value.

MarcoWedel

Hi,

besides using the null() function, you could also negate your condition and omit the else part (so if() returns null in the else case):


If(value <> 'x', value)

hope this helps

regards

Marco

sasiparupudi1
Master III
Master III

Please close this thread if you got your answer

Not applicable
Author

Hi Sasidhar,

The only option in Actionss that I have is "Mark as Helpful."  I'm definitely missing something simple.  How do I "close the thread?"

Thanks!

Greg

MarcoWedel

you should see a correct answer button.

regards

Marco

MarcoWedel

QlikCommunity_Thread_171395_Pic1.png

Not applicable
Author

I was looking at the thread in My Inbox, and the Correct Answer option wasn't displaying there.  Opening it in a new tab, made it display.

Thanks!