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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

considering null values in script

Hi All, 

I have a field called  Category which has  many  null values   as shown in the  screenshot  below . 

I am trying to  consider null values in the script like this 

If(Isnull( Category),'NULL',Category) as CAT, but this is not renaming the null values , it remains the same 

 Can you please help me in handling this ? 

 

Thanks in Advance 

Labels (1)
1 Solution

Accepted Solutions
vchuprina
Specialist
Specialist

Hi,

Looks like null and (null) are not nulls it’s a text, so probably your expression should be

IF(Wildmatch(Category, '*null*') or IsNull(Category), 'NULL', Category) AS Category

Also if you have empty rows you can add third condition

IF(Wildmatch(Category, '*null*') or IsNull(Category) or trim(len(Category))=0, 'NULL', Category) AS Category

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").

View solution in original post

1 Reply
vchuprina
Specialist
Specialist

Hi,

Looks like null and (null) are not nulls it’s a text, so probably your expression should be

IF(Wildmatch(Category, '*null*') or IsNull(Category), 'NULL', Category) AS Category

Also if you have empty rows you can add third condition

IF(Wildmatch(Category, '*null*') or IsNull(Category) or trim(len(Category))=0, 'NULL', Category) AS Category

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").