---
title: "Union tables and stack rows in Strata | Oplema"
description: "Stack rows from several tables with Union. Columns line up by name or position, and a Source column records which table each row came from."
url: "https://oplema.com/docs/strata/combine/union"
updated: "2026-11-04"
---

# Union

Union stacks rows from the tables you connect, aligning columns by name or position. A Source column records which input each row came from, such as input\_1. With By column name, differing columns can all be kept, reduced to the shared ones or stop with an error. By position stops with an error if the tables have different numbers of columns. Rows come out in the order the inputs are connected.

**Learn this in context:** [Combine CSV files when a column has been renamed](https://oplema.com/learn/many-sources/combine-files-with-renamed-columns) (Combine and reconcile data files)

## Stack two months of orders

January has two orders and February has three. Both connect to Union, aligned by column name.

Result
| order | amount | Source |
| --- | --- | --- |
| 1001 | 120 | input\_1 |
| 1002 | 75 | input\_1 |
| 1003 | 240 | input\_2 |
| 1004 | 60 | input\_2 |
| 1005 | 95 | input\_2 |

1. Look at the preview. It has five rows in one table. The `Source` column shows input\_1 for January and input\_2 for February.
2. Clear Source Column Name. The `Source` column disappears, and the five rows stay.

## When to use

Use Union when several tables hold the same kind of rows, such as one export per month or per region. To add columns from another table by matching a key, use Join.

To combine tables side by side on a key, use [Join](https://oplema.com/docs/strata/combine/join).

## Inputs and outputs

### Inputs

1 port

**In Required**

Accepts: Tables, Geospatial data.

Accepts multiple connections on this port.

### Outputs

1 port

**Out**

## Configure the block

**Align**

How input columns are aligned. By position reports an error when inputs have different numbers of columns.

Default: `By column name`

Options: By column name, By position.

**When columns differ**

Applies to By column name. How to handle inputs whose column names don't match. Keep all fills missing values with null, Common columns only keeps the intersection, Error stops before running.

Default: `Keep all columns`

Options: Keep all columns, Common columns only, Error on mismatch.

**Source Column Name**

Name of the column that tags each row with its input (input\_1, input\_2 and so on). Clear the box to leave the column out.

Default: `Source`

## Union FAQs

**What happens when the columns differ?**

With By column name, When columns differ decides: keep all columns, keep the common ones or stop with an error. By position reports an error when the inputs have different numbers of columns.

**Can I leave out the Source column?**

Yes. Clear Source Column Name. The rows stay the same.

**In what order do the rows come out?**

In the order the inputs are connected.

### Prepare your data. Build it in Strata.

Strata opens in your browser, with no account.

[Open Strata](https://oplema.com/editor?path=%2F%3Fopen%3Dstrata) [About Strata](https://oplema.com/strata)
