How to use two data sources in one chart #31733
Replies: 1 comment
-
Hey there, @joycedoor! I'm a bot designed to assist you with bugs, questions, and contributions. I'm here to help out while you wait for a human maintainer. How can I assist you today? A similar issue was discussed in the Superset community. One suggested solution is to use SQL Lab in Superset to write a SQL query that joins your virtual dataset (Sales) with your physical dataset (KPI). After joining the datasets, you can hit the "Explore" button to create a chart from your query. This approach allows you to create a Superset-managed view where the SQL is stored in its definition and queries are run against it as a subquery [1]. Alternatively, you can create a view in your source database by joining the tables and use this view as a datasource in Superset. This method is often preferred as it pushes data preparation to the database itself, making it available for other BI platforms as well [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
I now have two datasets:
I want to draw a bar chart that can show the current sales amount and the KPI in one single chart, but Superset only allows me to choose one single dataset for one chart. How can I do it?
The reason why I do not want to query a new dataset that contain both Sales and KPI data is that the sales dataset requires a lot of preprocessing (which I already did using SQL Lab), so I don't want to alter it anymore, and the KPI data need to be updated seasonally. If I were to query a dataset contain all the info, I will have to get a new dataset every month (which is bad for maintaining my dashboards). I just want to update the KPI numbers monthly and hope to see that in the dashboard without making new datasets.
Beta Was this translation helpful? Give feedback.
All reactions