Documentation

    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.

    Stack two months of orders

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

    The live example needs a desktop screen. The result it produces is shown here, and the explanation and settings below work on any screen.

    Result
    orderamountSource
    1001120input_1
    100275input_1
    1003240input_2
    100460input_2
    100595input_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.

    Inputs and outputs

    Inputs

    1 port
    InRequired

    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.