Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikmpate0
Creator II
Creator II

How can I incorporate null values as zero in a calculation?

I have a calculation  a- b but sometimes a or be may be null, how can I script this?

my code looks something like this at the moment:-

join(Temp table)

Load

*,
(
A) - (B) as Diff;

12 Replies
Anonymous
Not applicable

Mina

Before your Load statement in your load script add a couple of lines similar to this :

Set NullValue = '0' ;

Nullasvalue [YourFieldName] ;

Load .......................

Best Regards,    Bill

qlikmpate0
Creator II
Creator II
Author

thank you Bill, for your prompt response.

qlikmpate0
Creator II
Creator II
Author

Thanks to all who replied, I ended on using the following:-

if(isnull(A), 0, (A)) - if(isnull(B), 0, (B)) as Diff;

Although the other suggestions are equally suitable.

Thanks again.