Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

Null as zero

How to convert the Null values as Zero in the Qvd Generator file

17 Replies
sunny_talwar

May be like this:

NullAsValue *;

SET NullValue = 0;


Temp

LOAD Emp name,

    Emp ID,

    Desg;

SQL SELECT *

FROM emp;

manoranjan_d
Specialist
Specialist
Author

Thanks

manoranjan_d
Specialist
Specialist
Author

If i want to do Null as 0 for one field below is correct?

if(amount=null, 0,amount) as amount

settu_periasamy
Master III
Master III

Hi,

it should be like

=if(isnull(amount),0,amount) as amount

Not applicable

Yes it's correct...!

Anonymous
Not applicable

yes

load qvd file or any other file if the particular field is the have the null values to give in script

if(amount=null, 0,amount) as amount

or try in this way

replace(amount,'null','0') as amount

tejasp47
Contributor
Contributor

I was trying to compare the 2 fields -

Data, where comparison was with value and NULL or NOTHING field.

I think many of the above solution may work to achieve my work. But I tried Alt function and it worked for me.

I used the complex formula for the KPI field, but the simple form of it -

Field1       Field2         Alt (Field1, 0) - Alt(Field2, 0)

--               78%           -78%

10%          20%           -10%

vishsaggi
Champion III
Champion III

May be this?

IF(Len(Trim(amount)) = 0, 0, amount) AS Amount