Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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" ?
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>
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>
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.
Awesome, thank you Jonathan!