Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
stekol61
Creator
Creator

NULL values in script

Hi!

I'm loading ticket data with some different date fields:

If (not isnull(inc_wip_date), inc_wip_date, inc_cleared_date) as inc_wip_date,

if(not isnull(inc_wip_date),'1','0') as script_wip_Null_check,

inc_ID,
inc_cleared_date,
inc_create_date
// inc_wip_date,
FROM

 

 

The result looks like this:

wip_check.PNG

The 'inc_wip_date' is modified by the first expression in the load script. The original value of  'inc_wip_date' is NULL for this ticket.

The 'script_wip_Null_check' expression see this as a NULL value.

I want to use this modified 'inc_wip_date' in an expression but since  seems to be a NULL value it will not be possible to use.

How can this be handled?

1 Solution

Accepted Solutions
nikitadeshwal
Partner - Contributor III
Partner - Contributor III

Hi,

Try below code and check again

load *,
if(not isnull(inc_wip_date1),'1','0') as script_wip_Null_check;
load *,
If (not isnull(inc_wip_date), inc_wip_date, inc_cleared_date) as inc_wip_date1;
Load
inc_ID,
inc_start_date,
inc_cleared_date,
inc_pending_date,
inc_create_date,
inc_wip_date,

FROM ....

Thanks

Nikita Deshwal

View solution in original post

3 Replies
nikitadeshwal
Partner - Contributor III
Partner - Contributor III

Hi,

Try to write this expression 

if(not isnull(inc_wip_date),'1','0') as script_wip_Null_check 

in preceding load  and check result.

 

 

stekol61
Creator
Creator
Author

Hi!

I updated the LOAD script as below but the result is still the same.

If (not isnull(inc_wip_date), inc_wip_date, inc_cleared_date) as inc_wip_date,

inc_ID,
inc_start_date,
inc_cleared_date,
inc_pending_date,
inc_create_date,
// inc_wip_date,


if(not isnull(inc_wip_date),'1','0') as script_wip_Null_check

FROM 


/Stefan

nikitadeshwal
Partner - Contributor III
Partner - Contributor III

Hi,

Try below code and check again

load *,
if(not isnull(inc_wip_date1),'1','0') as script_wip_Null_check;
load *,
If (not isnull(inc_wip_date), inc_wip_date, inc_cleared_date) as inc_wip_date1;
Load
inc_ID,
inc_start_date,
inc_cleared_date,
inc_pending_date,
inc_create_date,
inc_wip_date,

FROM ....

Thanks

Nikita Deshwal