Let us say for instance you have a Sales database that contains yearly sales data stored as individual tables (like Sales 2016, Sales 2017 etc). What if you want to merge the "Sales 2016" data along with the "Sales 2017" data and create a consolidated table such that you can analyze the sales across all the years? This is where the data merging feature comes in handy. You can merge the data from any number of tables and store it as a single table for reporting and analysis.
Zoho Analytics uses the Query Table feature to merge datasets.
Data merging is a method for merging similar datasets from two or more tables to create a single data set (table) for easy reporting & analysis. Zoho Analytics allows you to merge datasets using a Query Table.
Query Table is a feature that enables you to prepare data for easy reporting and analysis. You can fetch data from one or more tables in a Workspace and create specific data views using the standard SQL SELECT queries. These data views are similar to tables and you can perform operations such as report creation, sharing, and even create another Query Table over an existing Query Table.
You can create Query Tables for filtering datasets, merging datasets together (union), transforming data, applying SQL query functions, joining datasets and more.
Click to learn more about Query Tables.
Zoho Analytics allows you to merge two or more datasets (tables) using UNION sql function in Query Tables.
Please do note that the columns that you wish to merge across the multiple tables should be of compatible data types.
Let us assume that you have 2 tables containing sales data from the year 2016 and 2017.
Following image shows the structure of the table containing sales data for the year 2016.
Following image shows the structure of the table containing sales data for the year 2017.
You can now merge the two datasets by following the below steps:
The below query combines data from the table "Sales 2016" along with data from the table "Sales 2017". A sample of the data will be displayed at the bottom of the query on execution.
SELECT
"Date",
"Customer Name",
"Product",
"Product Category",
"Sales",
"Cost"
FROM"Sales 2016"
UNION ALL
SELECT
"Date"
"Customer Name",
"Product",
"Product Category",
"Sales",
"Cost"
FROM"Sales 2017"
Click here to learn more about the UNION function.
Yes, please do ensure that the following conditions are met before merging two datasets.
In case if any of the above-mentioned criteria are not met, you will not be able to merge the tables.
No, you can merge data from any number of tables and save it as a single table.
Yes, any changes that you make to the parent tables will automatically reflect in the query table as well.
This error will occur when the number of columns selected from the tables are not equal.
In our example, Sales 2016 contains 6 columns, whereas Sales 2017 contains 5 columns.
This issue can be rectified by specifying an equal number of columns from both the tables.
This error statement will occur when you
To avoid this make sure that all the column names are unique. if not make the display column names unique by defining different alias names for the duplicate display columns.
Yes, you can create any type of report over this query table as you do over a normal table. Refer to the Creating Reports Section to learn more.
Yes, you can link the merged query table with any other table using a Lookup column.
To do so,
Click to learn more about creating lookup columns.
Please refer to the following document to learn more about Query Tables - https://desk.zoho.com/portal/zohocorp/kb/articles/query-tables-for-data-preparation
Relational Modelling | Creating Formulas | Query Table