Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
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:

If(Len(Trim(FieldName)) = 0, 0, FieldName) as FieldName

sunny_talwar

Or this:

Alt(FieldName, 0) as FieldName

MK_QSL
MVP
MVP

If(IsNull(FieldName) or Len(Trim(FieldName))=0,0,FieldName) as FieldName

manoranjan_d
Specialist
Specialist
Author

if i go in this way i shd do for all fileds, i wan to do for all fileds in one single shot, any idea?

ankit777
Specialist
Specialist

hi

You can try nullasvalue function

see below for reference

NullAsValue | Qlik Community

MK_QSL
MVP
MVP

Use NullAsValue function.

sunny_talwar

Look at the sample:

NullAsValue *;

SET NullValue = 0;

Table:

LOAD If(Len(Trim(Val1)) > 0, Val1) as Val1,

  If(Len(Trim(Val2)) > 0, Val2) as Val2,

  If(Len(Trim(Val3)) > 0, Val3) as Val3;

LOAD * Inline [

Val1, Val2, Val3

3, , 4

2, 4,

, 2, 4

];

Anonymous
Not applicable

try this one

Alt(FieldName, 0) as FieldName

or try in this way

if(fieldname=null, 0)

manoranjan_d
Specialist
Specialist
Author

Temp

LOAD Emp name,

    Emp ID,

    Desg;

SQL SELECT *

FROM emp;

this is my example code now where shd use this null function, any idea