Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rxp03570
Creator
Creator

Replacing Blank values with Null()

Hi All,

I have a requirement where I have to replace blanks in the existing field values which has blanks with Null
(). For this requirement I'm using  if( len(trim(CORP))=0, null(), CORP).

The above requirement works with single field, but I have to do the same thing for all the fields available in the data set. Can anyone help me how to replace blanks for the entire dataset's available across all fields with Null().

Thanks

Rahul

1 Solution

Accepted Solutions
satishkurra
Specialist II
Specialist II

What you can do is to convert NULL value in the script

This code has to be before MyTable1:

Map_Nulls:
Mapping LOAD
NULL(),
‘<Unknown>’
AutoGenerate 1;

And this after MyTable1:

MAP FieldName, * using Map_Nulls;

View solution in original post

2 Replies
vishsaggi
Champion III
Champion III

You can use NullASValue like in Qlik. Try below in your script.

NullAsValue *;

OR

NullAsValue Field1, Field2, ...;

SET NullValue = 'Null';

LOAD *

FROM .....;

satishkurra
Specialist II
Specialist II

What you can do is to convert NULL value in the script

This code has to be before MyTable1:

Map_Nulls:
Mapping LOAD
NULL(),
‘<Unknown>’
AutoGenerate 1;

And this after MyTable1:

MAP FieldName, * using Map_Nulls;