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: 
tracycrown
Creator III
Creator III

Change null to zero

Dear all

Kindly advise how to change quantity from null to zero in scrip, so that total sales equals $0.00 instead of '-' (null) ?.

Total sales = Quantity x Unit Price = 0 x $5.00 = $0

Total sales = Quantity x Unit Price = '-' x $5.00 = '-' (null value)

 

I have tried the following in script but not working :

if(Quantity = 0, 0, num#(Quantity,'#') as Quantity,

 

Thanks, Tracy

 

 

Labels (1)
3 Replies
Mark_Little
Luminary
Luminary

Hi,

You need to have a look at NULLasValue function.

Null as value Qlik help 

marcus_sommer

For the described scenario you could apply: alt(Quantity, 0) as Quantity

udit_k
Partner - Creator II
Partner - Creator II

Hi , use ALT function of replacing null values in isnum replace.

use coalesce function of replacing num values in istext replace.