[Filter Box] Option to bind filter-boxes based on their datasource
Make sure these boxes are checked before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if any
- [x] I have reproduced the issue with at least the latest released version of superset
- [x] I have checked the issue tracker for the same issue and I haven't found one similar
Superset version
Master version
Expected results
Being able to apply filterbox filters partially on only slices from the same datasource. This can be important in large dashboards or dashboards with mirrored slices.
Actual results
As of the latest version of Superset, filterboxes filters are applied globally to all slices in a dashboard as long as the column name of the filter is present in the slice, with the only exception being the Filterbox slice itself.
Steps to reproduce
We suggest adding an a checkbox to optionally apply datasource binding to filterboxes. With the checkbox selected, filterbox that is created from datasource X will only be applied to slices made from datasource X in the dashboard.
We believe that this feature has many different use cases. Also, having this option would not break existing dashboards.
Use case 1: For example, let's say we have company dashboard that visualizes marketing efforts. The dashboard could be divided into sections with each section focused on the sales/results/campaigns of a certain region.
These sections are identical to each other with the exception of the datasource.
Without this feature, our filters will be applied to each section even though it is unnecessary. It also prevents other filterboxes from being used as other filterbox slices will have its options restricted by the filters. While the latter can be solved using the 'immune to filter' option, the first issue cannot be solved if we would actually like to be able to apply filters to it from a seperate filter box.
By having this feature, we can prevent unwanted filters to be applied on unrelated slices with conflicting column name.
While it is true that we can have seperate dashboards for each section, doing so would make it harder for comparisons to be made and also provide a worse user experience for the dashboard user.
Use case 2: In a general-purpose dashboard with no conflicting columns, it is likely that a dashboard contains slices from multiple datasources. Applying a filter reloads ALL slices except the filter box itself, leading to unnecessary API calls and waiting times for the dashboard user.
By adding an option to bind filter boxes to datasources, we can apply the reloading on only affected slices thus prevent unneeded reloading on unrelated slices which takes place even where there are no column names conflict.
Use case 3: In the case where we want a filter box to be applied globally, this can also be possible by simply not applying the binding when creating them
We believe that this feature would be really helpful for Superset users and we are willing to work on a PR for this feature. Would appreciate any feedback or response.
Thank you!
I think this features is important and necessary. When we have many slices in a dashboard, a global filter will make it hard to choose the right slices to be filtered.
Relevant: http://superset.apache.org/faq.html#how-to-add-dynamic-filters-to-a-dashboard
Filter Box as we know it is likely to get deprecated or migrated in favor of dashboard-native filters. The new dashboard app will land in master in the next few weeks, and filter dashboard should follow soon after.
Dashboard-native filters are not charts and will likely be scoped (global, per-tab, per-section, ...). I'm hoping that both from a design and consumption standpoint it will be very clear which charts are affected by which filters.
In the meantime, feel free to contribute a checkbox to Filter Box though it may not migrate nicely as it may not match the new model/structure.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.
I have another question.
Is it possible and how to achieve this:
- Filter box 1 from datasource 1
- Filter box 2 from datasource 2
- I select value in field Year in filter box 1 and this is replicated on the same field with the same value on filter box 2. Both filter boxes have this field but from different datasources.
Thank you.