How to support single select drop-down filter for a "question"


#1

Hi, there,

anybody know how to enhance the metabase source code to support single select drop-down filter for a “question”? The current version only support multiple select drop-down filter then a SQL clause of “IN (…)” will be generated.

When you “ask a question” in metabase with the “native query”, you can input a SQL clause with variables. If the variable type is “field filter” and the filter widget type is “category”, you add a drop-down box for the variable. But that drop-down box has to be a multiple select drop-down box. But a single select drop-down box is expected. Any idea?


#2

Not sure if this applies to all databases (I’d expect it to), but in MS SQL Server
WHERE x in (1)
and
WHERE x = 1
are optimised to exactly the same query plan.

What are you hoping to gain?


#3

I think @guan is asking for single-select instead of multi-select - there’s a request for that, go and vote by clicking :+1: