Custom filter error in an explore

low_priority
done
reply
(jkk) #1

This filter works in SQL runner however when I apply this as custom filter in the explore, it throws error “Expression incomplete”

year_month >= ‘2018-01’ and year_month <= ‘2019-03’

year_month is defined as ‘String’ in my table

0 Likes

(Izzy) #2

I think there’s a few things at play here.
First, I bet it will give you a more helpful error message if you change those single quotes to double quotes, which Looker Expressions (unlike SQL) require.

But, I don’t think you’ll be able to do a >= operation on two strings in a custom filter. You’ll need to turn them into dates by using the date() function like date(2018,01,01). Then, it should work! You’ll also have to turn year_month into a date to do the comparison.

1 Like