Union
Union
can help you combine two similarly structured tables vertically. That is, it is to append a table below another table, so it adds more rows to the original table. Generally, Union is used for two tables with the same or similar properties of columns.
Inputs
The Union
action requires two pieces of inputs:
Table names that you want to append together
Columns names that allow the exact one to one mapping of each column from one table to the other
Acho will automatically recognize column names that are exactly matching from the two tables and assume that those are to be stacked together. However, if the naming convention from the two sides differs, some effort will need to be spent on specifying the mapping.
Union multiple tables
If you have multiple CSV files with exactly the same number of columns and column names, you can also try uploading them as Multiple CSV files. This method combines multiple CSV files as a single resource by using Union.
Modify the number of columns to map
If you don't want to append tables based on all columns, you can click the minus icon to remove the columns that you don't need. If you remove some of the columns accidentally, you can click the plus icon to get those columns back.
The maximum number of columns cannot exceed the number of columns in the first table. Take the above graph as an example. If the orders_Jan
table has 3 columns, the maximum number of the columns that you can specify is 3 even if the order_Feb table has 4 columns.
Union Example
Below is a demo table called "customers" :
and another demo table called "suppliers":
By applying the Union action, you would need to provide the column mapping between these two tables. Also, make sure that all column types match well. For example, a string column can only be merged with a String column.
Below is the result table after Union. As indicated, ContactName
, Address
, City
, PostalCode
, and Country
are now merged.
Troubleshooting
Why some of the rows are duplicated?
The Union action uses UNION ALL
function in SQL. It appends all data points from one dataset to another dateset no matter whether some rows are duplicated. If you don't want to have duplicated records, you can use the deduplicate function to filter out redundant rows.
Last updated