cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

Re-Using Datasets inside the Same SQL Dashboard

mtreigelman
New Contributor II

Hi folks, I am creating a SQL dashboard and want to know if I can re-use datasets within the same dashboard. 

The screenshot below captures what I would like to do pretty well, but to summarize... I need to run an computationally expensive query and want to visualize those results in a figure on the dashboard. I then need to aggregate that table further to create additional figures. Is there a way I can call the first query again so that my SQL warehouse does not need to run that expensive first query twice? 

databricks_dash_dataset_recycle_question.png

5 REPLIES 5

Walter_C
Databricks Employee
Databricks Employee

You should be able to do it by using static widgets as mentioned in docs https://docs.databricks.com/en/dashboards/index.html#static-widget-parameters  

seans
New Contributor III

This still needs a solution. @Walter_C gave a reference to having two visualizations use the same dataset. This question (and my current problem) is about referencing a SQL dataset as if it was a view inside another SQL dataset in the dashboard. Dataset "my_agg" references dataset "my_raw" in the same dashboard (this is before any visualizations are defined, so parameters and widgets have no bearing yet). 

sonynbcu
New Contributor II

Bumping this. I also have a use case where it would be beneficial to reference one dataset from another dataset.

rskuntoji24
New Contributor II

Would appreciate a solution on this at the earliest as well. Thanks!

mtreigelman
New Contributor II

@rskuntoji24 My current workaround has been to create the first query as a materialized view in my catalog, and then run a workflow daily to update the view. 

The downsides to this strategy is that it might not be practical for streaming data (not an issue for me personally), and creating a materialized view is saving the data that the query outputs somewhere (so storage requirements are increasing). I am not sure exactly where materialized view data is being stored, but I would guess somewhere on your cloud provider... perhaps someone like @Walter_C  could confirm. 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now