Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

khaycock
Contributor

IF and Null statement

I have a statement that I am looking to display the 0 and nulls if they are present but I can't get the IF statement to show the nulls. 

It's quite a beefy IF statement but if the field ActualDaysDifference is 0 or blank, I want it to keep that. It works for 0 but not for the blanks so I'm not sure what to do?

if(ActualDaysDifference = ' ' or '0', ActualDaysDifference,if(ActualDeliveryDate<PlannedDeliveryDate, networkdays(ActualDeliveryDate,PlannedDeliveryDate)*-1, WorkingDaysDifference)) AS DaysDifferenceAgain

Labels (2)
4 Replies
mwoolf
Honored Contributor II

Re: IF and Null statement

Try:

if(isnull(ActualDaysDifference)

or

if(len(ActualDaysDifference)=0

khaycock
Contributor

Re: IF and Null statement

These don't bring in all the fields with 0 AND that are null though, surely it's just one or the other?

mwoolf
Honored Contributor II

Re: IF and Null statement

if(isnull(ActualDaysDifference) or ActualDaysDifference=0 , ...

or

if(len(ActualDaysDifference)=0  or ActualDaysDifference=0 , ...

Support
Support

Re: IF and Null statement

Did Mike's final post help you resolve things?  If so, please be sure to give him credit by clicking the Accept as Solution button on his post.

Here are some additional links that may help a little as well:

https://community.qlik.com/t5/Qlik-Design-Blog/Finding-NULL/ba-p/1474279

https://community.qlik.com/t5/Qlik-Design-Blog/NULL-The-Invisible-Nothing/ba-p/1467674

Regards,
Brett

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.