Data merging in Zoho Analytics allows you to combine similar datasets from two or more tables into a single unified dataset for reporting and analysis. This is achieved through Query Tables using SQL UNION functions, giving you one consolidated view of data that would otherwise be split across separate tables.
What is a Query Table?
A Query Table is a virtual data view created using a SQL SELECT statement. It behaves like a standard table within your workspace and can be used as the basis for reports, dashboards, and further query tables. The Query Table is automatically updated whenever the underlying source tables change.
How to Merge Data Using a UNION Query
- Open the workspace. Navigate to the workspace that contains the tables you want to merge.
- Create a new Query Table. Select New > New Query Table from the workspace menu.
- Write a UNION ALL query. In the SQL editor, enter a UNION ALL query that selects the columns you want to combine from each table. For example, to merge two annual sales tables:
SELECT [columns] FROM "Sales_2024" UNION ALL SELECT [columns] FROM "Sales_2025" - Save the Query Table. Give the query table a unique name and save it. It now appears as a table in your workspace.
Requirements and Limitations
- The datasets being merged should be similar in nature (for example, the same type of transaction data from different periods).
- Each SELECT statement in the UNION must reference the same number of columns.
- Corresponding columns across SELECT statements must have compatible data types.
- All resulting column names in the final dataset must be unique.
Note: There is no limit to the number of tables that can be combined in a single UNION query. Use UNION ALL (not UNION) to retain duplicate rows; UNION removes duplicates, which can affect totals.
What You Can Do After Merging
- Build any report type (charts, pivot tables, summary views) over the merged query table.
- Link the merged query table to other tables in the workspace using lookup columns.
- Any changes to the source tables are automatically reflected in the merged query table.
Need help? 1 Cloud Consultants can design complex data models in Zoho Analytics, including multi-table merges and query tables that bring all your data together in one place.
Book a discovery call with 1 Cloud Consultants.