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: 
Not applicable

IF in script in order to replacing zero values into time

Hi All,

Why is this    expression

if( IsNull(OPNTIJD)=0,OPNTIJD,0.33333)

working well as normal expression but not working when i do this in the script

as below.

LOAD

OPNDAT,

OPNTIJD,

if( IsNull(OPNTIJD)=0,OPNTIJD,0.33333) as ADMDAT

Resident BEDOCUP;

My goal is to replace zero value´s into 08:00 hour preferable is to do this in the script.

THANKS IN ADVACE!!

1 Solution

Accepted Solutions
masha-ecraft
Partner - Creator
Partner - Creator

Try this:

LOAD

OPNDAT,

OPNTIJD,

if( IsNull(OPNTIJD), 0.33333, OPNTIJD) as ADMDAT

Resident BEDOCUP

View solution in original post

7 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Are the values to change definitely Nulls and not zeros?

Not applicable
Author

please try this script

if(len(trim(OPNTIJD))=0,0.33333,OPNTIJD) as OPNTIJD

Not applicable
Author

Yes  absolutly nulls and not zero's

Not applicable
Author

No unfortunatly ït is not working

masha-ecraft
Partner - Creator
Partner - Creator

Try this:

LOAD

OPNDAT,

OPNTIJD,

if( IsNull(OPNTIJD), 0.33333, OPNTIJD) as ADMDAT

Resident BEDOCUP

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Masha's right - you're IsNull() is reversed! 0=False, -1 or nothing = True.

Not applicable
Author

THANKS THIS WORKS WELL