[FR] Composite Data Source
Problem: Users who have multiple erpnext sites with the same doctypes & fields need to have a consolidated view of data across all sites. Currently, they have to connect to each site and create individual reports. This still doesn't give them a consolidated view of data. They need to store the query results using Query Store and then create a report. This is a tedious process.
Solution:
Create a checkbox in Insights Data Source called Is Composite which when checked will allow the user to select multiple data sources (already connected) that have same database type and same table & column structure.
For eg.
- Let's say we have 3 sites,
abc.erpnxt.com,xyz.erpnext.comandpqr.erpnext.comand all of them have the same doctypes & fields. - We will connect all 3 sites to Insights by adding 3 data sources of type
MariaDBwith site credentials. - We will create a new data source called
Consolidated Accountsand check theIs Compositecheckbox. - We will select all 3 data sources in the
Data Sourcestable. - We can optionally select the common tables from each data source. In this case, we will add only one table,
GL Entry, so only one Insights TableGL Entrywill be created with only the common columns from all 3 sites. - Now, when the
Consolidated Accountsdata source is selected in a new query, the generated SQL will be the same as if we had selected one of the underlying data sources. - While executing the query of a composite data source, the query will be parallelly executed on all the underlying data sources and the results will be merged and returned to the user. Optionally, the site name can be added as a column in the result set.
adding multiple datasources is a killer feature. will this eventually work with different database providers and different schemas? Even Superset can not do this AFAIK.
I have this exact same issue right now Using v13
Would like to consolidate financial data across multiple erpnext sites!