adding 12 months roll back filter to the explore

  • 6 July 2021
  • 1 reply

I want to add a 12 months look back filter to the explore so that, the explore always gets the data for the last 12months. currently I have a dimension created with type date_month_name in the view for a given date column from the database table

1 reply

If you only ever want your explore to show the most recent twelve months, use a sql_always_where with the appropriate database syntax. Without knowing what you’re using, it’s going to be something like:

date > (now() - 12 months)

Your database likely contains functionality to perform date math like that.