Hello, there.
-
Create a question using Metabase’s graphical builder (so it’s not a native query) displaying data as Table and save it as a Saved Question.
-
Make a new question aggregating some data (i.e. showing a chart or similar) based on the previous Saved Question as its source.
-
Embed the question from (2) into a dashboard.
4. Add a Category filter to the dashboard and try to achieve “dropdown category functionality” on that filter for questions deriving from Saved Questions - impossible? Instead, a text-input filter shows.
I’ve tried putting directly the Table-view question from (1) into the dashboard and I can indeed categorically filter data using a dropdown that correctly populates.
My bet is that saved questions are not parsed by Metabase internally and searched for their distinct values to be later used as dropdown-filter values. Correct?
A possible solution would be having Saved Questions within Administration - Data Model to set properties such as “Category” or “Foreign Key” on those saved questions as well, but hey, that is not implemented.
I am thinking of a workaround:
- create new questions showing all distinct values for fields I want to filter with dropdowns,
- create a HTML page embedding my dashboard (and hiding Metabase filters by means of CSS),
- putting my own HTML filter elements above the dashboard iframe and populating them with values from the first bullet (distinct field values) by accessing those questions via Metabase API
- when my HTML filter elements are changed, I refresh the dashboard iframe by changing its src attribute as I have to append ?filtername=filtervalue based on what the users clicked on my own filter elements
A lot of work to achieve quite a little, to be honest.
Any comment would be appreciated.
Best,
Denis