Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Pico
Partner - Contributor III
Partner - Contributor III

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

 

 

 

Labels (1)
12 Replies
marcus_sommer

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

Pico
Partner - Contributor III
Partner - Contributor III
Author

That's nice. It actually works

Pico
Partner - Contributor III
Partner - Contributor III
Author

Thank you very much. It's much more clear now