Persistent widget-level query filter setting?
Hi, is it possible to make the widget-level query filters in a dashboard persistent, similar to the widget-level query parameters?
The use case is my dataset contains a type colum categorizing data into two types, A and B. I'd like to have a dashboard with one visualization widget displaying type A data, and another widget displaying type B data (groupings can't be used to display both sets of data on the same widget since I'm already grouping on a different column - would be nice to be able to group by multiple columns!)
Today there are two options:
- Set
typeas a query parameter and add two widgets, each with a widget-level query parameter or static parameter values set toAandBrespectively.
- The two widgets each display the data for the selected parameter. Upon refresh the parameter values are persistent, however the underlying query can only have one query parameter configuration specified. When the query is refreshed on a schedule, only the widget with query parameter matching that of the underlying query is updated, the other widget must be refreshed separately.
- Set
typeas a::filterand add two widgets, and selectAfor one andBfor the other.
- The filter selection is not persisted. When the page is refreshed, both widgets default to
A.
Option 2 is preferable since data is fetched only once, and all the widgets are updated. It also doesn't require a refresh to add a new widget with a different display, or change the display on an existing widget.
This would be a great feature to be able to re-used the same query results multiple times in the same dashboard.
I think this makes sense, and probably something we would want to implement.
One alternate solution for you is to actually have 3 queries: one that fetches the data from your A and B types together, then two others that use that query result as their data source and just apply a WHERE filter / have it as a parameter. You'd then be able to refresh both queries on a schedule, and if you used the cached query results version of the first query, they should be able to only query the actual source data once.
Interesting, will try that out!