Why does my date comparison in filters/table calculations lead to an "Invalid filter expression" error?

Knowledge Drop

Last tested: Jan 21, 2019
 

This can happen if you are comparing a LookML Date field with just a date value in quotes " ". For example:

${view_name.created_date}="2015-07-16"

While that may work when comparing String values, this will NOT work with dates.

The way to make that a valid date expression in Table Calculations and Custom Filters is:

${view_name.created_date}=date(2015,07,16)

Note the use of the date( ) function.

This content is subject to limited support.                

Version history
Last update:
‎04-05-2021 09:02 AM
Updated by: