Union tool icon

Union Tool

Last modified: November 05, 2021

Docs are available before the release of Designer Cloud so you can get a sneak peek. This content might change between now and the official release.

One Tool Example

Union has a One Tool Example. Visit Sample Workflows to learn how to access this and many other examples directly in Alteryx Designer Cloud.

Use Union to combine 2 or more datasets on column names or positions. In the output, each column contains the rows from each input. You can configure how the columns stack or match up in the output.

Tool Components

Thumbnail

The Union tool has 2 anchors: 

  • Input anchor: The input anchor connects to the data streams you want to unify. The 2 angle brackets on the input anchor indicate that it accepts multiple inputs. 
  • Output anchor: The output anchor displays the output dataset.

Configure the Tool

Union Method: Choose the configuration method. The default setting is Automatically Configure by Column Name.

  •  Automatically Configure by Column Name: Stack data by column name.
  • Automatically Configure by Column Position: Stack data by the column order in the stream.
  • Manually Configure: Allows you to manually specify how to stack data. When you choose this method, the columns in each input are displayed (indicated by row #1, #2, etc.). You can Reset a table By Position or By Name.

When the mode is set to Manually Configure, Designer Cloud assumes the configuration doesn't change between the configuration of the tool and the time the workflow is run.  If anything is missing, an error occurs and the workflow stops.

Properties 

When Columns Differ

For the auto-configuration modes, you have to select how to handle columns that differ.

  • Warn (Continue Data Processing): Throws a warning in the Results grid, but continue processing rows. 
  • Error (Stop Data Processing): Throws an error in the Results grid and stops processing records.
  • Ignore (Continue Data Processing): Ignores columns that differ and continues processing rows. 

Column Output Options

  • Output All Columns: Output includes all columns. Null values populate empty columns.
  • Output Only Common Columns: Output includes only the columns that each input has in common.

Properties: Manually Configure Fields

For the Manually Configure method, you have to configure your Output Properties

To begin, your data streams are staggered horizontally and vertically so that the data from each input dataset are in different cells. 

  1. (Optional) In the dropdown, you can begin by selecting either By Position or By Name. Select Reset to reset the columns. Use this option if you know that your data streams have some columns that match by either position or name. 
  2. Next, use the arrows to begin stacking your data. Select a cell and select the left arrow or right arrow to stack it with the data field it matches. 
  3. Check Pass data downstream without waiting for all inputs to process to pass data rows downstream without waiting for all inputs to send data. Do not use this mode if the upstream metainfo will change between configuration time and runtime.

Output Order

Under Output Order, check Specify Output Order to specify which input dataset's data displays 1st in the output. After you check that box, select and hold the reorder icon in the table and drag the connection up or down.

The Specify Output Order option can cause slower performance.

Understanding the Output

2 aspects of the Union tool output are important to understand: the column names and the order of the data.

Understanding Output Data Column Names

The column names that are used in the output dataset are pulled from the input stream with the 1st alphanumeric value.

By default, your input data streams are labeled #1 and #2 based on the order you connected them to the Union tool input anchor. So, if the column names differ, the output dataset uses the column names from the #1 input dataset.

If you prefer to use the column names from the #2 input dataset, change the name for the input connections. Select the input streams and enter new values. The output column names are taken from the connection with the 1st alphabetical/numerical value in its name.

Thumbnail

Understanding Output Data Order

The default output order corresponds to the order in which you connected your input datasets to the Union tool input anchor. Go to the Output Order section to learn how to change the order of your output data. 

Was This Page Helpful?

Running into problems or issues with your Alteryx product? Visit the Alteryx Community or contact support. Can't submit this form? Email us.