# Union Transformation

Union transformation is used to combine incoming data from two or more inputs into a single output. Any duplicate records are preserved in the Union’s output. Union transformation functions similar to union operator in a SQL query.

A Union transformation has multiple input nodes and a single output node. Each input node receives data from a different set transformation. An input node in a union transformation cannot receive data from two different set transformations.

## **Usage**

Use Union Transformation to combine data from two or more incoming streams. If inputs are sorted and you need the result to be sorted, [*Merge Transformation*](https://documentation.astera.com/v/astera-data-stack-v7/dataflows/transformations/merge-transformation) is a better way of accomplishing that.

## **Steps**

To add a *Union* transformation, drag the *Union* object from the *Transformations* group in the Flow toolbox and drop it on the dataflow.

An example of what a *Union* transformation might look like is shown below:

![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FC0M2gZ7VNAEbAuLqTOEd%2F0.png?alt=media)

To configure the properties of a *Union* object after it was added to the dataflow, right-click on it and select *Properties* from the context menu. The following properties are available:

* *Meta Object Builder screen:* This allows you to add or remove fields in the field layout, as well as select their data type. The fields added in *Meta Object Builder* will show in the *Output* node, as well as all *Input* nodes inside the object box.
* *Union Transformation Properties screen:* Enter your input items in the grid. The name you assign to an input item should help you remember its purpose. Each input item will have its own Input node in the object box, so that it can be mapped to receive data from an upstream object on the dataflow.

{% hint style="info" %}
**Note:** Entering input items in the grid should be done prior to mapping the *Union* object. Once you close the *Properties* dialog box, each input item will have its own Input node in the object box.
{% endhint %}

* *General Options* screen: This screen shares the options common to most objects on the dataflow:
  * *Clear Incoming Record Messages*: When this option is on, any messages coming in from objects preceding the current object will be cleared. This is useful when you need to capture record messages in the log generated by the current object and filter out any record messages generated earlier in the dataflow.
  * *Do Not Process Records with Errors*: When this option is on, records with errors will not be output by the object. When this option is off, records with errors will be output by the object, and a record message will be attached to the record. This record message can then feed into downstream objects on the dataflow, for example, a destination file that will capture record messages or a log that will capture the messages and as well as collect their statistics.
  * The *Comments* input allows you to enter comments associated with this object.
