Hi,
Yesterday we upgraded to newest version of metabase and some of our dashboards stopped to work. I have an SQL query to filter previous days in postgres. It was set to variable contains number. Where clause looked like that:
WHERE ("source"."Datetime" >= date_trunc('day', (now() + (INTERVAL '-{{number}} days'))))
The input for variable is created, but somehow will not insert it value into query, as it returns empty results The column index is out of range: 1, number of columns: 0.
The same equivalent without variables though returns result WHERE ("source"."Datetime" >= date_trunc('day', (now() + (INTERVAL '-1 days'))))
I have also tried using concat(), or || to join '-' {{number}} 'days', but none of the options worked for me.
Is there a new way how to do what my previous variable filter did, or is it an unintended bug?
After updating to v0.46, SQL queries with variables in column names stopped working.
In our cenario, I used to have a variable {{default_days}} that was used in the query to define whether table column default_d1 or default_d15 should be used
I used it as follows, and it worked just fine
select
default_d{{default_days}}
from default
Now, after updating to v0.46, I get the error
ERROR: column "default_d$2" does not exist
Funny thing is, when I select the variable by itself, it returns the value it is set to. select {{default_days}} returns '1' or '15' depending on what is inputed to the filter.
I'm not sure but I think this might have been caused by changes made to the variables. In v0.46, there were changes to make it possible to create a custom list for a dropdown text variable, for instance.