Extra filters (to the chart as query params) #32754
Replies: 4 comments
-
Hi, For those interested in testing the improvement, there's a branch where you can install and verify here Here's one example introducing the filter to the chart via URL:
decoded_url: encoded url: I'm also attaching a chart I created. Please let me know if you find this feature useful for superset :) |
Beta Was this translation helpful? Give feedback.
-
Seems highly valuable. Worth noting that @mistercrunch and @Vitor-Avila were also discussing similar filter URL schemas for dashboard context (embedded or otherwise), so these should probably be aligned in approach. |
Beta Was this translation helpful? Give feedback.
-
Agree this will be highly valuable. The biggest value creator in my mind, which I think this solves for but Richard please confirm, is that this would enable a way to - in an embedded dashboard - retrieve a dashboard that is "pre-filtered" with a handful of selections. Equally valuable would be if this also opens up a method of retrieving (again in an embedded dashboard) what filters a user selected so that those can be saved to a database and later retrieved (essentially creating dynamic bookmarking functionality for embedded dashboards). |
Beta Was this translation helpful? Give feedback.
-
Used to be a feature in early Superset - not sure if there's still a [documented/undocumented] way to do this. Note that we have support for Rison (url-friendly-encoded-json), and that it could be great to have simplified semantics for simple equalities. Currently you have to pass complex data structures where you specify operators (in, equals, different, greater, ...) but in many cases you just need |
Beta Was this translation helpful? Give feedback.
-
Extra Filters
Contribution Summary
We added the ability to pass filters to Superset charts via URL parameters. This feature lets you:
How It Works
The extra filters feature works by:
extra_filters
This approach keeps the original chart configuration intact while allowing for dynamic filtering based on URL parameters.
Working URL Example
This example shows how to filter a chart to show data for the UK (GBR), metric 1 greater than 3, and metric 2 greater than 0:
Original chart URL (without filters):
Simplified URL (decoded):
Simplified URL (encoded):
Screenshot (chart with extra_filters)
Common Filter Operations
The extra filters feature supports all standard Superset filter operations:
==
,!=
>
,>=
,<
,<=
IN
,NOT IN
BETWEEN
LIKE
,ILIKE
IS NULL
,IS NOT NULL
Why This Matters
This feature solves several real-world problems:
The extra filters functionality makes Superset charts more flexible and easier to integrate with your existing systems and workflows.
Beta Was this translation helpful? Give feedback.
All reactions