As discussed on this topic on 'Get Help', there appears to be a bug with the behavior of variables used in strings after updating to v0.46
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 prior to v0.46
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
It happens whether the variable type is set to 'Text' or 'Number'
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. But when using it on a string, it appears to be evaluated as '$2'
Could this have been caused by changes made to the variables in v0.46? For instance, there were changes to make it possible to create a custom list for a dropdown text variable.
- Your browser and its version: Chrome 111.0.5563.146
- Your operating system: Windows 11
- The type of database(s) you've connected to Metabase: Postgres
- The version of Metabase you're running: 0.46
- Repeatable steps to reproduce the issue: create a SQL query that uses a variable in a table column name