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

replacing blank value with string

hi QV,

how do we handle blank values in Qv,

I have a field like DEL_BLOCK,some of that fields records coming as blank from DB.so I want to assign a string for blank values.

looks below is the cond i have used,is it fine??

If(IsNull([DEL_BLOCK]=' '),'Free','Blocked') as Blocked


Thanks


1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Please use TRIM, since you could have spaces into your field

If(len(trim([DEL_BLOCK]))=0,'Free','Blocked') as Blocked

View solution in original post

4 Replies
Anonymous
Not applicable
Author

try with

If(len([DEL_BLOCK])=0,'Free','Blocked') as Blocked


Marc.

Clever_Anjos
Employee
Employee

Please use TRIM, since you could have spaces into your field

If(len(trim([DEL_BLOCK]))=0,'Free','Blocked') as Blocked

JonnyPoole
Employee
Employee

NULL is different to blank. Its a long story...

NULL:

If(IsNull([DEL_BLOCK]),'Free','Blocked') as Blocked


Blank:

If([DEL_BLOCK]='','Free','Blocked') as Blocked


or like clever said


If( trim([DEL_BLOCK])='','Free','Blocked') as Blocked


or like marc said


If(len([DEL_BLOCK])=0,'Free','Blocked') as Blocked

Anonymous
Not applicable
Author

If(IsNull([DEL_BLOCK]),'Free','Blocked') as Blocked