Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
lbalestieri
Contributor II
Contributor II

Need to replace blanks with null

Hello! i saw some post about replacing nulls or blanks.

the closest post was this one https://community.qlik.com/t5/New-to-QlikView/Replacing-Blank-values-with-static-value/m-p/1559134#M...

I know if i use the "len(trim(field))>0" i can get rid of blanks but i have a lot of tables and a lot of fields so i need another way.

Thx for your help!

2 Solutions

Accepted Solutions
Anil_Babu_Samineni

If there are many, I suggest you to work with "ApplyMap" concepts in Qlik.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

Vegar
MVP
MVP

if you can't use nullintepret then a mapping table could be a good alternative solution, mentioned by @Anil_Babu_Samineni .
If you have a lot of fields that needs mapping I would recommend you not to use the applymap() but instead use
map *fieldlist using MapName

It will allow you to use the map table more efficiently on many fields without writing the applymap(...) for every single field.

Read more here: https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...

View solution in original post

4 Replies
Anil_Babu_Samineni

If there are many, I suggest you to work with "ApplyMap" concepts in Qlik.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
lbalestieri
Contributor II
Contributor II
Author

In the main() i use this sentence to replace nulls with Empty

Set NullValue = '< Empty >';
NullAsValue *;

What mapping do you suggest on this example  below? i mean, if you can (or someone) write the explicit code.

I can select the blank fields but i dont find a way to replace them for a null value or '< Empty >'

 

Vegar
MVP
MVP

What is your data source? Is it a text file, excel or inline source? If so then you could use nullinterpret.
E.g. :
set NullInterpret ='';

Read more: https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Value...
Vegar
MVP
MVP

if you can't use nullintepret then a mapping table could be a good alternative solution, mentioned by @Anil_Babu_Samineni .
If you have a lot of fields that needs mapping I would recommend you not to use the applymap() but instead use
map *fieldlist using MapName

It will allow you to use the map table more efficiently on many fields without writing the applymap(...) for every single field.

Read more here: https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...