Qlik Community

QlikView Expressor

Discussion Board for collaboration related to QlikView Expressor.

jamiehicks71
New Contributor III

Working with Nil Dates in Expressor

I need to filter on a date field that contains null values. The schema is a table schema against a table in teradata. I tried to edit the schema by not allowing Null values on that date field, and then setting the default value to 2000-01-01. The Schema accepted 2000-01-01 as valid, but when I run the dataflow, 2000-01-01 is rejected.

Here is the filter logic that I am using against the date field:

input.Discharge_Date >=string.datetime("2010-01-01","CCYY-MM-DD")

The filter fails because there are nulls in the Discharge_Date field. How do I avoid that?

3 Replies
Employee
Employee

Re: Working with Nil Dates in Expressor

you can keep the null values as is and in the filter you can do something like

input.Discharge_Date ~= nil

where 'nil' is the datascript / lua representation for null.  This will allow non-null values through and reject records with null date values.  

jamiehicks71
New Contributor III

Re: Working with Nil Dates in Expressor

Do I need to set up a ~= nil filter before my other filter in the dataflow, or can I include that statement with the filter I already have?

Employee
Employee

Re: Working with Nil Dates in Expressor

You'll want to clear what you did in the schema and then replace your existing Filter expression - that is,  if I understand your requirement

Community Browser