Hello there,
Using metabase 0.25.2, we’ve had difficulties using Variables corrrectly. Every time we’ve tried on 0.25.2, the “Settings” tab stays greyed out.
Here’s the process i’ve followed:
Click on the “New question” button
create a new SQL query
paste one of the following
click on the “X” icon (Variables).
Queries tried:
select count(*)
from users
where country = {{ country}}
select count(*)
from users
where {{ country}}
SELECT count(*)
FROM userdata_metadata
WHERE 1 =1
[[AND country = {{ cat }}]]
Database: Postgres/RDS. Metabase is hosted on aws beanstalk.
Is this a known bug? What other info would you need to understand what happens ?
sameer
September 13, 2017, 4:04pm
2
what browser are you on? the snippets you’re showing should bring up the variables pane
maz
September 13, 2017, 4:42pm
3
I think you’ve found a bug with a simple fix, @ni.paris : all you have to do is get rid of your leading/trailing spaces in the braces surrounding your variables’ names. I.e.,
select count(*)
from users
where country = {{country}}
or
SELECT count(*)
FROM userdata_metadata
WHERE 1 =1
[[AND country = {{cat}}]]
maz
September 13, 2017, 4:45pm
4
I’ve opened a github issue for this here:
As reported here. I repro-ed it on our stats branch on Chrome.
Currently, this query won't recognize the cat variable:
SELECT count(*)
FROM userdata_metadata
WHERE...
Bug
Parameters/Variables
Priority/P2
Query Builder/Native
I m using Chrome on MacOS
@maz : will try this fix and report
@maz I’ve checked and removing the spaces works. Thanks !
1 Like
maz
September 19, 2017, 3:20am
7
Glad to hear it! Sorry about that. Hopefully we can get that issue fixed soon so others don’t run into this.