Can someone please assist. I have a dashboard on Superset connected to a dataset in BigQuery. One can go and apply filters on the dashboard. After applying the filters, I want to insert a complete button that one can select to generate the SQL behind the applied filters to generate the table in BigQuery which contains the data of the applied filters.
Create a custom control: In Superset, you can create a custom control using Superset's extensibility features. This control will serve as the button to capture the selected filters. (Superset documentation)
Define the button behavior: Within the custom control, define the behavior to capture the selected filters. Use JavaScript to access the filter values and store them in variables or an intermediate storage mechanism.
Trigger the query process: Once the filter values are captured, you need to trigger a process to query them back on BigQuery. This can be done by calling a JavaScript function or making an API request to an endpoint that handles the query execution.
Construct the BigQuery query: In the query execution endpoint, construct the BigQuery query based on the captured filter values. You can use a query builder library or concatenate strings to dynamically generate the query with the necessary filter conditions.
Execute the BigQuery query: Using a BigQuery client library or API, execute the constructed query against the BigQuery database where the data is stored. Retrieve the filtered data based on the selected filters.
I have this broad explanation of what to do but I struggle with the specifics.