Templated filter not found error

  • 29 June 2017
  • 5 replies

I’m trying to create a templated filter for dates in my View file. Here’s the gist of my code:

view: myview{
derived_table: {sql:
where {% condition date_filter %} start_datetime {% endcondition %}
filter: date_filter{
type: date
default_value: "7 days ago for 7 days"

But I keep getting a "Variable not found “date_filter” error. Does anyone know what I’m doing wrong?


5 replies

Userlevel 3

Hey @gklo,

This error often comes up when this view is being referenced in an explore using the from parameter. You can combat this case by appending the view name in the templated filter such as {% condition myview.date_filter %}

Let me know if that works for you!


Thanks, Morgan! Unfortunately, it’s still not working. My colleague was able to get it running in another repo, though. Do you think it could be a permissions issue?

Userlevel 3

Hi @gklo,

I encourage you to come on chat or visit so we can get some more details from you!

Hi I’m also trying to get this to work and the above solution did not work for me either. Was there an alternative suggestion you had to get it to work?

nevermind, I found my answer here – Templated filters and derived tables