Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
eduardo_dimperio
Specialist II
Specialist II

Set a value to a null in several fields

Hi,

I've a table with several fields, and all have in common that Null Values will set to 'N/A'.

I can do something like If(Isnull(FieldA),'N/A',FiedlA), but i dont want to do this to all fields, so there's a way to set all Null values in my table to N/A?

I saw something like Set NullAsValue 'N/A' but didn't work

 

Thank you

Labels (1)
1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

Sorry didn't read your post clearly
its not set NullAsValue
your variable should be NullValue
start of your script put

SET NullValue = 'N/A';
NullAsValue *;

View solution in original post

6 Replies
dplr-rn
Partner - Master III
Partner - Master III

Those variable will only work if NullAsValue is activated . Try starting with

NullAsValue *;

at the beginning of your script. 

 

refer

https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Scripting/Sc...

dplr-rn
Partner - Master III
Partner - Master III

Sorry didn't read your post clearly
its not set NullAsValue
your variable should be NullValue
start of your script put

SET NullValue = 'N/A';
NullAsValue *;

eduardo_dimperio
Specialist II
Specialist II
Author

Hi,

I did a simple test.

 

SET NullValue = 'N/A';
NullAsValue *;


LIB CONNECT TO 'MySQL';

[CONTATOS_USERS]:
SQL SELECT 
`id` AS ID_CONTATO,
`name` AS NOME_CONTATO
FROM
mzp1e_users;

CONTATOS_INFOS:
SQL SELECT 
`id` AS ID_CONTATO,
`cliente_empresa` AS EMPRESA
FROM
mzp1e_cck_store_form_clientes;

exit script;

But didn't work

image.png

eduardo_dimperio
Specialist II
Specialist II
Author

Sorry my friend, you are right, my print is not a null but a missing value. Your code works to null values

Thank you

dplr-rn
Partner - Master III
Partner - Master III

thats weird

i actually tested before i suggested it (gave nonsense null value deliberately)

SET NullValue = 'N/sdA';
NullAsValue *;

result

Capture.PNG

 

 

dplr-rn
Partner - Master III
Partner - Master III

great to hear 🙂