Using liquid parameters in SQL breaks filter suggestions

OmarS
New Member

Hello,

I am writing custom SQL to define my table in Looker and I’m trying to filter date within the look using liquid parameters like this:

WHERE TO_DATE(ORDER_CREATED_AT) BETWEEN TO_DATE({% parameter StartDate %}) AND  TO_DATE({% parameter EndDate %})

This is one of the parameters:

  parameter: StartDate {
type: date
convert_tz: no
}

The problem is after I included this line, the filter suggestions for my other fields stopped showing. I went through looker documentation hoping to find a fix with no luck. If anyone can help with this it would be greatly appreciated.  

0 2 141
2 REPLIES 2

Hi @OmarS , currently I made something similar with a derived table, but I used “filter” instead “parameter”.  

Here is my view where I defined my derived table:

60216b9c-4c79-47f7-9ace-e84db048632f.png

And here is my dim_date view where I defined my filter:

eb708921-3c77-4db0-8b68-ac15d3ddeb2f.png

Maybe you can apply something similar.

OmarS
New Member

Thanks for the reply! I will give that a shot right now.

Top Labels in this Space
Top Solution Authors