To add a column from Table1 as a filter to Table2 in Databricks Dashboards, you can use the dashboard parameters feature. Here are the steps:
-
Create a visualization for each of your SQL queries. You can do this by clicking the '+' next to the Results tab and selecting Visualization. Save your visualizations.
-
Create a dashboard using these visualizations. You can add a second widget to the dashboard from the Add drop-down list and select the appropriate query.
-
Add a dashboard parameter to each query. This is done by adding a WHERE clause to your SQL query to filter the query by the desired column. For example, if you want to filter by a column named 'column1' from Table1, you would add this clause before the GROUP BY clause: WHERE column1 IN ({{ column1 }}).
-
Update the dashboard to use the dashboard parameter. Open your dashboard, and for each visualization, click the kebab menu and then click Edit. In the Parameters section, click the pencil icon for the Widget parameter in the Value field. Change the Source to New dashboard parameter.
-
Verify that 'column1' is selected as the Key value. Click OK and then click Save. The widget parameter for the visualization should no longer appear.