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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load or Display Null Values as "Unknown"

I have production status values in a Status field and some rows contain null values. How do I either load or display the null values as "Unknown" ?

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

the isnull() function will check if a value is null.

So in the load editor you could recalculate each status using an IF() expression using isnull() as the condition as follows:

LOAD

     if ( isnull(Status),'Unknown', Status)  as Status,

     otherfields...

from <source>

View solution in original post

3 Replies
JonnyPoole
Former Employee
Former Employee

the isnull() function will check if a value is null.

So in the load editor you could recalculate each status using an IF() expression using isnull() as the condition as follows:

LOAD

     if ( isnull(Status),'Unknown', Status)  as Status,

     otherfields...

from <source>

jagan
Partner - Champion III
Partner - Champion III

Hi Jason,

I think handling this in script is a better option, try any one this in script

TableName:

LOAD

*,

Alt(Status, 'Unknown') AS Status

FROM DataSource;


OR


TableName:

LOAD

*,

If(Len(Trim(Status)) > 0, Status,  'Unknown') AS Status

FROM DataSource;


OR


TableName:

LOAD

*,

If(IsNull(Status),  'Unknown', Status) AS Status

FROM DataSource;


Regards,

Jagan.

Not applicable
Author

Awesome, thank you Jonathan!