Combine two or more datasets into one
Combine stacks the rows of two or more datasets in one place. Tick the datasets under Data in the left sidebar, then click Combine in the selection bar; you need edit access to the project. You choose one of two ways, and they leave you with different libraries.
Use it for monthly exports that arrive as separate files, or the same report from several regions. To put columns side by side (matching rows on a key) instead of stacking rows, use a Join or Lookup in a View's pipeline: see Join two datasets on a shared column.
Open the Combine dialog
- In the Data Library, tick two or more datasets in the list.
- In the selection bar, click Combine. You can also right-click one of the selected rows and choose Combine.
- The Combine 2 datasets dialog opens (it counts your datasets): "Put their rows together in one place. Two ways, and they leave you with different libraries."
Combine is available only when the selection holds datasets that are ready:
| Message | Why |
|---|---|
| "Only datasets can be combined." | The selection includes a folder, a View or a raw file |
| "“Sales” is not ready yet." | One of the datasets is waiting on your input |
| "“Sales” is still processing." | One of the datasets is still processing |
With view-only access, Combine and the other selection actions are unavailable.
Choose between batches in one dataset and sending into a dataset
Step 1 shows two cards, each with a before-and-after diagram. When both are available, nothing is selected for you; when only one is, it is picked. Pick one and click Next.
| Option | What happens | Afterwards |
|---|---|---|
| Batches in one dataset | "The originals are consumed, and their refreshes go with them." The rows become batches in the dataset you keep. | 2 datasets become 1 |
| Send into a dataset | "The originals stay, and keep sending rows as they refresh." Their rows append into a new or existing dataset. | 3 datasets become 4 (or stay 3 when you send into one you already have) |
Pick Batches in one dataset to tidy up: for example, two uploads of the same report that should have been one dataset. Pick Send into a dataset when the originals have their own refreshes or pipelines you want to keep, and you want one dataset that collects from all of them.
Merge two datasets as batches in one dataset
This option is available only when all of these are true. When it is not, its card says why.
| Condition | Message when it fails |
|---|---|
| Exactly two datasets are selected | "Two datasets at a time" (the column mapping is set up per pair) |
| Neither dataset has more than one View | "“Sales” has 2 views, so there is no answer to which one survives." |
| Neither dataset has steps in its View | "“Sales” has 3 steps built on it, so its rows cannot move." |
- Choose Batches in one dataset and click Next.
- Under Keep which one?, pick the dataset that stays. Each option shows its columns and rows. "Each batch keeps its own name and date, so you can suspend or remove one later."
- If the two datasets have different numbers of columns, a warning says you will match columns next. Otherwise, any columns that don't line up are matched in the next step.
- Click Combine into (the button names the dataset you keep).
- The Add data dialog opens on the dataset you kept, with Select existing and the other dataset already chosen. Check the column match there.
- Leave Delete dataset after combining ticked, so the other dataset stops existing. See Add or replace data.
The dataset you kept holds both sets of rows as separate batches. Check them in its Batches section under Settings & history: see Manage batches.
Send several datasets into one that keeps updating
This option works for any number of datasets. Each original gets a Send to Dataset step at the end of its View (the View you were last in, or its first View). The step runs every time that View's pipeline runs, so the destination keeps receiving rows as the originals refresh. For the step itself, see Join two datasets on a shared column.
Send into a new dataset
- Choose Send into a dataset and click Next.
- Under Send into, choose New dataset ("The originals stay and keep sending to it.").
- Type a name in Name the new dataset. The new dataset goes into the folder you are in, or the top of the project.
- Check the column review (see below).
- Click Create (the button shows the new name), or press Enter in the name box.
The dialog stays open and shows its progress: "Reading the columns of each dataset…", "Creating the new dataset…", then, for example, "Sent 2 of 3…".
Send into an existing dataset
- Choose Send into a dataset and click Next.
- Under Send into, choose An existing dataset ("Any dataset in this project. Its columns stay as they are.").
- In the finder that opens, pick the destination and click Choose a dataset. You can pick any dataset in the current project except the ones you are combining. To pick a different one, click Change.
- Check the column review.
- Click Send into (the button names the destination).
If one of the originals already sends its rows to that dataset, it is left out of this send, and the dialog says so. Sending it twice would add its rows twice on every refresh.
Match columns that differ between datasets
Before you send, Review columns shows what happens to each column, with the counts (for example 4 in all, 1 in some).
For a new dataset, the new dataset gets every column from every original, matched by name:
- A column that only some originals have is kept, and is "Empty in rows from" the others.
- Columns with close names are flagged ("Looks like the same column as …"). Click Make one column to merge them.
- Leave out drops a column from the new dataset.
- A column that is not the same type in every dataset becomes text, and the review says which types it found.
For an existing dataset, its columns stay as they are. Each original's columns are matched into the destination's columns by name, and you can send a column into a different destination column. Columns with no match are listed under "Left out: these have no column in" the destination.
If nothing from one original fits, the button is disabled. Send at least one of its columns into a column in the table, or go back and leave that dataset out of the selection.
What you see after the send
| Result | Message |
|---|---|
| New dataset created | "Created “All regions”. Its rows come from 3 datasets and update when they refresh." with Open |
| Sent into an existing dataset | "“All regions” now gets rows from 2 more datasets and updates when they refresh." |
| Some columns had no match | "Region, Code had no column of the same name in “All regions” and were not sent." |
| A column was widened | "Order ID held more than one kind of value, so it is text in the new dataset." |
| Nothing sent | "Nothing was sent. Your datasets are unchanged." |
Sources are sent one at a time, and the send stops at the first failure. The message then says how many were sent, for example "Sent 2 of 3 to “All regions”, then West failed." The destination keeps what was sent.
Limits
| Limit | Value |
|---|---|
| Batches in one dataset | Exactly two datasets, each with one View and no steps |
| Send into a dataset | Any number of datasets |
| Storage | Mammoth checks your workspace's storage limit before it sends. If the workspace is over its limit, the send does not start. |
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| "Two datasets at a time" | More than two datasets are ticked for Batches in one dataset. | Tick two, or use Send into a dataset. |
| "“Sales” has 2 views, so there is no answer to which one survives." | A dataset has more than one View. | Use Send into a dataset, or delete the extra View. |
| "“Sales” has 3 steps built on it, so its rows cannot move." | A dataset's View has pipeline steps. | Use Send into a dataset. |
| "There’s already a dataset called this here." | The new dataset's name is taken in this folder. | Type another name. |
| "Sent 2 of 3 to “All regions”, then West failed." | The send stopped at the first failure. | The destination keeps what was sent. Check the failed dataset, then send it again. |
| The send does not start | The workspace is over its storage limit. | Free space, for example by emptying Trash. See Get things back from Trash. |
Related
- Add or replace data: append or replace data from a file or one other dataset.
- Join two datasets on a shared column: match rows on a key instead of stacking.
- Send pipeline output to another dataset: the step that stacks rows.
- Dataset settings and history: batches for each dataset.
- Find your way around the Data Library: selecting datasets and bulk actions.
- Combine incoming data: add new files to a dataset automatically.
Something wrong? support@mammoth.io