append-datatables
Description
append-datatables
adaptor combines rows from two datatables into one datatable.
The output datatable includes all rows from the first
datatable followed by all rows from second
datatable. The number of rows in the output datatable will be exactly the sum of the rows in first
datatable and second
datatable.
By default, the output datatable will include all columns from both datatables, this can be changed by setting exclude unmatched columns
to true to exclude columns which do not exist in both datatables.
This adaptor is similar to a SQL UNION Operator, please consider using the join-datatables
adaptor to perform a SQL JOIN operation.
Inputs
first data
Type: datatable
Required: Yes
The first datatable.
second data
Type: datatable
Required: Yes
The second datatable.
exclude unmatched columns
Type: boolean
Required: No
Specifies whether to exclude columns which do not exist in both datatables. If unspecified, defaults to False
(all columns from both datatables will be included).
Outputs
data
Type: datatable
A datatable containing rows from both datatables.
Examples
Example 1: Default behaviour.
Inputs:
first data
:
Month | Sales (USD) | Sales (GBP) |
---|---|---|
Jan | 1458 | 1156 |
Feb | 9874 | 7835 |
second data
:
Month | Sales (USD) | Sales (EUR) |
---|---|---|
Mar | 4562 | 4173 |
Apr | 3654 | 3342 |
exclude unmatched columns:
null(empty)
Outputs:
data
:
Month | Sales (USD) | Sales (GBP) | Sales (EUR) |
---|---|---|---|
Jan | 1458 | 1156 | |
Feb | 9874 | 7835 | |
Mar | 4562 | 4173 | |
Apr | 3654 | 3342 |
-> Appended two datatables and included the unmatched columns.
Example 2: Excluding unmatched columns.
Inputs:
first data
:
Month | Sales (USD) | Sales (GBP) |
---|---|---|
Jan | 1458 | 1156 |
Feb | 9874 | 7835 |
second data
:
Month | Sales (USD) | Sales (EUR) |
---|---|---|
Mar | 4562 | 4173 |
Apr | 3654 | 3342 |
exclude unmatched columns
: True
Outputs:
data
:
Month | Sales (USD) |
---|---|
Jan | 1458 |
Feb | 9874 |
Mar | 4562 |
Apr | 3654 |
-> Appended two datatables and excluded the unmatched columns.
Use cases
Users are able to combine results from multiple sources.
Users can add additional observations or records to an existing datatable.
Users can combine time-series data from different time periods.
Last updated