Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to replace a null value ?

Hey everyone,

When I load a table, there are some null values in a field. I use this field to perform a join. I would like to replace the null values by a string "Unknown" because otherwise I get some trouble with my join.

I have tried :

if( isnull(fieldA), 'Unknown', fieldA ) as FIELD_A,

but it doesn't do what I want.

Any idea ?

Thanks for your help

3 Replies
Anonymous
Not applicable
Author

if  ( not  len(fieldA) > 0, 'Unknown', fieldA ) as FIELD_A,

senpradip007
Specialist III
Specialist III

Try like:

if(len(fieldA)=0, 'Unknown', fieldA) as Field_A

MK_QSL
MVP
MVP

If(IsNull(fieldA) or Len(Trim(Replace(fieldA,'-','')))=0, 'Unknown',fieldA) as fieldA