Cleaner where conditions with dates with Bigquery Explore

SungOh
New Member

Hey everyone!

I’m a data scientist/engineer who is pretty new to Looker. Currently I’m trying to use Looker Explores to enable data self-service for my team’s non technical members. I would like to know how to create cleaner date filter logic in the generated SQL.

Right now, adding a user defined date filter in Explore is generating a super messy SQL for something that should be really simple.

I’m sure I’ve overlooked some docs so would appreciate this community’s guidance! 

Thank you,

Sung

Explore filter:

abd7cc40-b98a-49fb-93dc-0201caa6ffc4.png

Lookml definition:

af33a021-75a5-4d6b-846b-293c6b280338.png

Resulting SQL 

82520c35-9b63-4db6-aa6d-296d5a4af06e.png
0 2 119
2 REPLIES 2

What does the SQL look like if you remove datatype:date ?

SungOh
New Member

Hey Dawid, thank you for the reply. Removing `datetype:date` results in this Bigquery error message:

invalidQuery: No matching signature for operator >= for argument types: DATE, TIMESTAMP. Supported signature: ANY >= ANY at [7:11]
Run
81876503-d523-4450-aa9a-787bf118ff56.png

Attached screenshot of generated SQL.

Top Labels in this Space
Top Solution Authors