Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

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

Labels (4)
1 Solution

Accepted Solutions
Highlighted
Master II
Master II

Can you please give a try on the below expression and see if it works:

=IF (Len([DATE])>0, 'Exists' , 'Does Not Exist')

View solution in original post

6 Replies
Highlighted
Creator II
Creator II

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')

Highlighted
Master II
Master II

Can you please give a try on the below expression and see if it works:

=IF (Len([DATE])>0, 'Exists' , 'Does Not Exist')

View solution in original post

Highlighted
Contributor II
Contributor II

Hi Anonymous 1
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
Highlighted
Contributor III
Contributor III

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?

Highlighted
Contributor III
Contributor III

hi, 

the 'Does not exists' option now remains permanently grey, and wont let me select it.  any ideas why that would be?

Highlighted
Master II
Master II

That is because your date is null/space and you cannot filter on null/space in qlikview.