Subtract
Subtract
is the opposite of Concatenate and lets you remove the common rows between two datasets, keeping only the unique rows.
Format
Subtract
uses a single utterance: Subtract the dataset <source dataset> from the dataset <target dataset> (and <keep/remove all duplicates>)
Parameters
Subtract
uses the following parameters:
source dataset
(required). The dataset to subtract from the target dataset.target dataset
(required). The dataset from which the source dataset should be subtracted.keep/remove all duplicates
(optional). Whether you want to keep all duplicate values in the final dataset or remove them from it.
Output
If the source dataset is successfully subtracted from the target dataset, a success message appears in the chat history and the resulting dataset is shown in the display panel. Otherwise, an error message is shown.
Examples
Consider the following datasets, which represent sales in 2020 and 2021, respectively:
Salesperson | Volume (units) | Gross Sales |
---|---|---|
Tony | 1000 | $200,000 |
Raj | 1500 | $300,000 |
Gary | 1250 | $250,000 |
Emilee | 1375 | $275,000 |
Sarah | 1400 | $280,000 |
Salesperson | Volume (units) | Gross Sales |
---|---|---|
Tony | 900 | $180,000 |
Raj | 1500 | $300,000 |
Sam | 1200 | $240,000 |
Danny | 1000 | $200,000 |
Mariah | 1220 | $244,000 |
To subtract the 2020 dataset from the 2021 dataset (and keep the duplicates), enter Subtract the dataset Sales2020 from the dataset Sales2021 and keep all duplicates
.
The resulting dataset looks like this:
Salesperson | Volume (units) | Gross Sales |
---|---|---|
Sam | 1200 | $240,000 |
Danny | 1000 | $200,000 |
Mariah | 1220 | $244,000 |