Filters on top of SQL queries, solution or workaround


We just upgraded to the last version of Metabase in order to have access to filters. But as I could have expected filters are not working for questions written in SQL. Am I correct?

I understand that this can be tricky to automatically filter on top of those but it would be such a game-changer if we could. I have 2 ideas:

  1. When creating a filter, we could pick one of the local variables v of the SQL queries and map it with the filter. Then we would automatically add “where v=” in the SQL query when using the filter. Not straightforward but seems doable
  2. Probably more general solution. Would be great to be able to publish a table generated out of question in order to be able to use it from another question later. This way I could generate a table out of SQL written questions and then use it from the simple question editor. And I could use filters on the question generated from the simple question editor

We’re adding parameters for SQL queries -

This was going to be in 0.18, but we never really got a settled UX in time for our code complete day. Rather than let 0.18 slip, we decided to push that feature to 0.19.

There’s an open PR, and we’ve settled on the new UX flows, so it’ll be coming out in the next version.

1 Like