# Union

In this document, you’ll learn how to use the *Union* transformation in Astera Dataprep to combine datasets from different sources with an existing dataset in your Dataprep Recipe.

### Use Case

A company wants to combine its *North Sales* dataset with *South Sales* and *East Sales* datasets. These additional datasets may exist as files, shared project sources, or database tables. The objective is to consolidate them into a single unified dataset for analysis.

1. In the toolbar, click on *Union* and select the appropriate source type.

<figure><img src="/files/fYIXOIibp2WHsFqjzoFx" alt=""><figcaption></figcaption></figure>

2. This will open the *Recipe Configuration – Union* panel. In this panel you can configure the source-specific settings (see tabs below).

{% tabs %}
{% tab title="Dataset" %}

<figure><img src="/files/ztcScVhvgEro84eycEXO" alt="" width="372"><figcaption></figcaption></figure>

* **Dataset:** Select the dataset you want to union with from the drop-down.
  {% endtab %}

{% tab title="File " %}

<figure><img src="/files/MAScgavSNMSRY2aw6l3D" alt="" width="370"><figcaption></figcaption></figure>

* **Browse Path**: Use this to manually browse and select your source file.
* **Path from Variable**: Use this when your file path is dynamic and parameterized. To learn more about using variables click [here](/dataprep/variables.md#using-variables-in-recipes).

For this use case, we’ll use the *Browse Path* option.

<figure><img src="/files/c3uXkrsoPDbf5m8tPv7d" alt="" width="346"><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Project Source" %}

<figure><img src="/files/sMJ0lvMu1nZGBf0aT7G4" alt="" width="369"><figcaption></figcaption></figure>

* **Filter Source:** Choose the type of source you want to use. You can filter by type or simply select *All*.

<figure><img src="/files/EHpt1y9EejdQmj38SP2F" alt="" width="417"><figcaption></figcaption></figure>

* **Shared Source:** From the drop-down, select the project source dataset you want to join.

<figure><img src="/files/REQ5K4KQfMLEoeOED8sO" alt="" width="347"><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Database Table" %}

<figure><img src="/files/AHIQWHRtbXoolGrb4Iu5" alt="" width="370"><figcaption></figcaption></figure>

* **Connection Name:** Select the shared connection you want to use. The drop-down lists all shared connections available in the project.

<figure><img src="/files/lcngOw9Ya3LvObC40KAT" alt="" width="347"><figcaption></figcaption></figure>

* **Table:** From the drop-down, choose the database table you want to union with. In this example, we’ll select the *southsales* table.

<figure><img src="/files/k0h1zxdEbCwng5ZfQKq8" alt="" width="347"><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

3. Provide a name for the union dataset (or keep the default name).

<figure><img src="/files/7EiyQZaiYWS76qLQgaj3" alt="" width="335"><figcaption></figcaption></figure>

4. Choose a *Union Type*:

<figure><img src="/files/XPgAybmhlk21tE6i0DUf" alt="" width="347"><figcaption></figcaption></figure>

* **Matching:** Returns only the fields that are present in both datasets.
* **All:** Returns all fields from both datasets.
* **Remaining:** Returns fields present in the current dataset along with the fields present in both datasets.

5. Once you’re done, click <img src="/files/MoI3HgBFnNJT7Jgo3HNm" alt="" data-size="line"> *Apply.*  The result will appear in the grid.

<figure><img src="/files/dWn4OFQholggRndglaT3" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.astera.com/dataprep/union.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
