> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Fix a join that returns zero or too many rows

> Fix a Mammoth Join that matches no rows or multiplies them: mismatched keys, spaces, case, types, empty keys and non-unique values in the joined View.
>
> Applies to: Where: View › Describe your transformation › Unify › Join

A Join that returns zero rows almost always has key values that differ between the two datasets. One that returns too many rows has repeating keys in the joined View. Both are fixed with a cleaning step before the join, on the **Join** task's inputs. For setting up a join, see [Join two datasets on a shared column](https://mammoth.io/docs/learn/clean-and-shape/join/).

## Fix a join that returns zero rows

Keys fail to match when they have:

- different wording, such as `US` and `United States`;
- trailing spaces: `New York ` doesn't match `New York`;
- different case: `APPLE` and `apple` may not match;
- different types, such as text joined to a number.

To diagnose, check the **Join type** first. An **Inner** join drops current View rows with no match; a **Left** join keeps them with empty joined columns. Then use **Preview Data at this Task** to compare a sample of keys on both sides.

| Problem | Fix, on both sides before the join |
| --- | --- |
| Spaces | **Text Formatting** with **Normalize whitespace** |
| Case | **Text Formatting** with **Change text case** |
| Different wording | **Find & Replace** to standardise values |
| Different types | **Convert Column Type** |

## Fix rows lost to empty join keys

**Empty join keys** lose rows too: the join completes, the row count drops and joined columns are empty. Rows with no `Customer_ID` can't match, and the Data Quality report shows a high share of empty keys.

1. Add a Conditional Filter to separate rows with empty keys.
2. Create a View for the records that need attention.
3. Set up a Messaging automation to alert your data quality team.

Check key completeness before you build complex pipelines.

## Fix a join that returns too many rows

Mammoth warns **Key column(s) have non-unique values** when the joined View's keys repeat, because each row then matches several rows. A Join that would produce more than 100,000 rows and more than five times the larger input is rejected. The task shows **Runtime error. Contact support for help.**, and the full message says the row count would rise to a very large value.

![Failing Join task outlined in red showing the runtime error and the Key column(s) have non-unique values warning with a More details link, above Delete and Fix error buttons](https://mammoth.io/docs/images/20261009_100706_JoinRowCountError.webp)

- Switch to **Lookup** if you need one value per row.
- Remove duplicates from the other dataset first, with **Remove Duplicate Rows** on the key column.
- Summarise the other dataset with **Group & Pivot** before joining.

## Related

- [Join two datasets on a shared column](https://mammoth.io/docs/learn/clean-and-shape/join/): join types and settings.
- [Fix a failing step](https://mammoth.io/docs/learn/clean-and-shape/fix-a-failing-step/): any task with a red error.
- [Data quality report](https://mammoth.io/docs/learn/explore/data-quality/): find empty keys and type problems before they break a step.

---
Source: https://mammoth.io/docs/learn/clean-and-shape/fix-join-problems.md · Updated: 2026-11-08
