Using the same text filter twice


I am trying to write a query with a text filter which acts as a placeholder to my aggregation level. Basically, it's a filter which can take the values 'day', 'week' and 'month' and specifies the aggregation level of my final query (giving a daily, weekly or monthly count). I need to use this placeholder filter twice in my query however I run into the following error:

ERROR: Assert Detail: ----------------------------------------------- error: Assert code: 1000 context: IsA(cons, Const) - query: 264826896 location: cg_expr_fn_builder.cpp:2645 process: padbmaster [pid=1073881217] -----------------------------------------------

The query looks something like this:

select date_trunc({{aggregation_level}}, "timestamp") as "date", date_add({{aggregation_level}},-1,"timestamp") as previous_dt
from my_table

I am using metabase v1.46.6.1 running Amazon Redshift.

What type of filter is that?

Btw: if you have a paid subscription please write to our support email

It's simply a text filter: on a given dashboard I may want to use daily, weekly or monthly aggregations of my data. This filter allows me to specify that when truncing the dates for aggregates.