
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IF NULL THEN... syntax
hi guys,
im wondering if you can help me, i believe i may have my syntax wrong for this 'if...null' expression.
im creating a list box, i want it to have 2 options: Exists or Does Not Exist:
=IF (IsNull([DATE], 'Does Not Exist', 'Exists')
basically, in the data, if the date is null then the inventory doesn't exist, otherwise it does exist. this statement does not work. anyone have any ideas?
regards
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please give a try on the below expression and see if it works:
=IF (Len([DATE])>0, 'Exists' , 'Does Not Exist')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you forgot to include bracket after Date
=IF (IsNull([DATE]), 'Does Not Exist', 'Exists')
if above doesn't work then use below
=IF (Len([DATE])>0, 'Exists', 'Does Not Exist')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please give a try on the below expression and see if it works:
=IF (Len([DATE])>0, 'Exists' , 'Does Not Exist')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What output are you getting? You should be able to do this in a list box.
Alternatively, you can try putting this expression in the script and aliasing it
e.g.
if(isnull([Field]),'Does not exist', 'Exists') as Existence
then create a list box using the field 'existence'
simply taking
=if(isnull([Date]),'Does not exist', 'exists')
seems to work for me. What output do you get? just a blank list box? please also check that the field name is correct and the field is populated

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
thanks to everyone for the responses, this seems to have worked. however, the 'Does Not Exists' option (i.e. all the NULLs) remains grey and never lets me select this. any idea why that would be?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
the 'Does not exists' option now remains permanently grey, and wont let me select it. any ideas why that would be?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is because your date is null/space and you cannot filter on null/space in qlikview.
