5 min readUpdated Mar 2, 2026

Union Logic Documentation

Overview

The "Union" logic component in the Vantage analytics platform is designed to combine two datasets into a single dataset. It can be utilized in various scenarios, whether to append data from two sources directly or to ensure that the final dataset contains only unique entries based on specified criteria. This powerful component allows users to manipulate and refine their data processing effortlessly, making it an essential tool for analytics tasks.

Settings

The following settings configure the behavior of the union operation:

1. unionMode

2. deduplicateKeys

3. sortColumn

4. sortDirection

5. columnMappings

6. selectedColumns

How It Works

  1. Input Handling: The component first unwraps the provided datasets (input1 and input2). If the inputs are invalid (not arrays), they are initialized as empty arrays.

  2. Column Mapping: If column mappings are defined, Input 2’s columns are modified according to the mappings before any other operations.

  3. Column Selection: If selectedColumns are provided, Input 2 is filtered to keep only those columns in the final output.

  4. Data Combining: Input 1 and the processed Input 2 are combined into one dataset.

  5. Duplicate Handling: If unionMode is set to 'distinct', the component identifies and removes duplicate rows based on deduplicateKeys or all columns, depending on the setting.

  6. Sorting: If sortColumn is defined, the resultant data is sorted according to its values, using the specified sortDirection.

  7. Output Generation: The final combined dataset is prepared as output and, if preview mode is active, includes metadata about the initial row counts from both datasets.

Use Cases & Examples

Use Case 1: Customer Data Integration

A business may have customer data split between two databases. Using the Union logic, they can consolidate data from both sources into a unified dataset for analytics or reporting purposes.

Use Case 2: Event Log Simplification

An organization collecting logs from two different systems could use this component to merge events into a single dataset for troubleshooting and analysis, ensuring only unique events are retained to simplify reporting.

Use Case 3: Financial Records Aggregation

A finance department could combine monthly financial records stored in two separate files to produce a comprehensive view, facilitating reconciliations and summaries.

Example Configuration

Assuming a tech company wants to merge employee records from HR and Payroll systems while ensuring unique entries based on email addresses and sorted by hire dates:

json
{
  "unionMode": "distinct",
  "deduplicateKeys": ["email"],
  "sortColumn": "hireDate",
  "sortDirection": "asc",
  "columnMappings": {
    "name": "fullName",
    "employeeId": null
  },
  "selectedColumns": ["email", "fullName", "hireDate"]
}

In this configuration: