Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
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