need a way how to create a custom drill down in superset and controll the filter and…
- User
need a way how to create a custom drill down in superset and controll the filter and option when open drill down or drill by feature in superset
- Assistant
need a way how to create a custom drill down in superset and controll the filter and option when open drill down or drill by feature in superset
Creating a custom drill-down feature in Apache Superset involves several steps, as the tool does not natively support this functionality out of the box. However, you can achieve it by leveraging filters, URL parameters, and custom SQL queries. Below, I will outline a method to create a custom drill-down feature in Superset:
Create the initial chart where you want to enable the drill-down feature. This could be a bar chart, pie chart, or any other chart that supports slicing and dicing the data.
Create a Dashboard and add the chart to this dashboard.
Create a filter corresponding to the dimension you want to drill down by (e.g., a date, category, or geographic location filter).
Add the filter to the Dashboard and configure it to affect the initial chart.
Create a detail chart that will display the detailed or drilled down data. This chart should be capable of responding to specific filter values – ideally through a custom SQL query that accepts parameters.
Create another Dashboard (Detail Dashboard) specifically for the drill-down view and add the detail chart to this dashboard.
Link the initial chart to the detail dashboard by using URL parameters. For example, you can add a hyperlink to chart elements or use a table with hyperlinks leading to the detailed dashboard. Configure the URL to include filter values as parameters.
Example:
http://superset.example.com/superset/dashboard/detail_dashboard?filter=dimension_valueModify the SQL query of the detail chart to accept URL parameters. This typically requires setting up a SQL Lab query to parse and use these parameters.
SELECT *
FROM your_table
WHERE dimension = '{{ filter_name }}'
Build custom visualization plugins if needed. Superset allows you to extend its functionality with custom plugins. Refer to the Superset documentation to build and integrate custom plugins.
Install and configure these plugins within your Superset environment to support more sophisticated drill-down capabilities.
While Apache Superset does not directly support drill-downs natively, by creatively using filters, URL parameters, and custom SQL, you can achieve a similar functionality. The approach outlined here should help you create a flexible and interactive drill-down experience within Superset dashboards.
Not yet included in a published release.