Filtering Charts Across Related Datasets in Apache Superset #30722
Replies: 2 comments
-
I found a similar discussion that might help you with your issue. In the discussion titled Filter chart data by foreign key, it was suggested to use dashboard filters in combination with virtual datasets. You can create a virtual dataset using SQL to join the Students and Schools tables, allowing you to filter by school_name instead of school_id. This approach should enable you to apply the desired filter across related datasets [1]. |
Beta Was this translation helpful? Give feedback.
-
I have a similar problem, but the two datasets are in different data sources. In other words, the table containing id and name are in one database, and the data I want to chart, grouped by id, is in another database. Is there no way for the filter to be based on name to allow the users to use the filter easily - but the ID provided to the chart's query is providing the IDs selected in the filter? |
Beta Was this translation helpful? Give feedback.
-
I'm frequently encountering a challenge in Apache Superset that I'm sure others might have also run into. Here’s the situation:
I have a dashboard with two datasets:
Students: Contains school_id along with other student-specific details.
Schools: Contains school_id, school_name, and additional school-specific details.
What I want to achieve is filtering charts from the Students dataset by school name rather than school ID. While I can create a filter on school_name, it doesn't work directly because the Students dataset doesn’t contain school_name—only school_id.
Currently, the filter only applies if I use school_id, which is not ideal. Is there a way to modify or extend the filtering functionality so that I can filter by school_name on charts that primarily use the Students dataset?
Beta Was this translation helpful? Give feedback.
All reactions