
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
NullASValue not working, sql load
Hi all,
I have issues using the command NullASValue.
Right now I have two loading from SQL scripts, like follows:
---------------------------------------------Section 1
Tab1:
NullAsValue *;
set NullValue = 'NULL';
SQL
select a.ID
from my_Anag a;
-------------------------------------------- Section 2
Tab2:
NullAsValue *;
set NullValue = 'NULL';
SQL
select b.ID, b.number
from My_Numbers b;
-----------------------------------------------
At this point Qlik joins the two tables, where the first one has much more IDs than the second one (containing also another filed, 'number', associated with the IDs).
the result is similar to:
ID | Number |
1 | 12345 |
2 | - |
3 | 45674 |
4 | - |
Instead I would like to have something that looks like:
ID | Number |
1 | 12345 |
2 | n.a. |
3 | 45674 |
4 | n.a. |
Thank you everyone for your time
- Tags:
- nulllasvalue
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Pico,
try below, Hope it will work for you.
it is not working unless we join both tables.
if you are referring only one column they try Apply_Map()
---------------------------------------------Section 1
Tab1:
SQL
select a.ID
from my_Anag a;
-------------------------------------------- Section 2
left Join
Tab2:
SQL
select b.ID, b.number
from My_Numbers b;
-----------------------------------------------
Table
ID "=if(IsNull(Number),'n.a.',Number)"
1 12345
2 n.a.
3 45674
4 n.a.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your approach isn't a join else you associate two tables - from an UI point of view. This means there is no NULL on the script-side which could be replaced with a default-value - your NULL happens later when the UI build the views. Depending on your requirements you could try to fetch it there within charts maybe with something like:
alt(Number, 'n.a.')
But it won't work within table-boxes and you could select/access it directly. If this is needed you must merge both tables within the script, maybe with:
m: mapping load *;
SQL select b.ID, b.number
from My_Numbers b;
t: load *, applympa('m', a.ID, 'n.a.') as number;
SQL select a.ID
from my_Anag a;
- Marcus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
you can try this condition at end of the table as where
WHERE 1=1;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I forgot to say that I've already tried it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try adding NullInterpret function above null value function, you may have blank which are not converting into 0.
SET NullInterpret ='';
NullAsValue *;
set NullValue = 'NULL';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sadly it doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, there are many possibility that can deserve this, If your nulls are real nulls you can either try
If(IsNull(Number), 'NA', Number) as Number
Or
If(Len(Number)=0, 'NA', Number) as Number

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It doesn't work.
Btw there are no null values in the DB I am loading from SQL: the null values comes from the join that Qlik sense applies to my two tables, if I understood correctly how it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's good, If you can share the sample data set to check the same?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Pico,
try below, Hope it will work for you.
it is not working unless we join both tables.
if you are referring only one column they try Apply_Map()
---------------------------------------------Section 1
Tab1:
SQL
select a.ID
from my_Anag a;
-------------------------------------------- Section 2
left Join
Tab2:
SQL
select b.ID, b.number
from My_Numbers b;
-----------------------------------------------
Table
ID "=if(IsNull(Number),'n.a.',Number)"
1 12345
2 n.a.
3 45674
4 n.a.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try this
=if(Number='','N/A',Number)
or
=if(Number='-','N/A',Number)

- « Previous Replies
-
- 1
- 2
- Next Replies »