Remove duplicate rows and add data quality checks
Remove Duplicate Rows deletes repeated rows, and a Data Check tests the pipeline's output against rules you set, such as "at least 1 row" or "no empty IDs". Find Remove Duplicate Rows in the Transform menu under Filter, Label & Replace, and Data Check under Controls. When a check fails, the pipeline either pauses or carries on with a flag, and Mammoth can email the people you choose.
Remove duplicate rows
- Select Filter, Label & Replace > Remove Duplicate Rows.
- In Evaluate duplicates from, choose which columns must match for two rows to count as duplicates (see the table).
- Tick the columns to leave out or to compare, if your choice asks for them.
- Click Apply.
| Evaluate duplicates from | A row is a duplicate when |
|---|---|
| All columns | Every column value matches exactly |
| All columns, except | Every column matches apart from the ones you tick. Use it when timestamps or auto-generated IDs differ between otherwise identical records. |
| Only specific columns | The columns you tick match |
From each set of duplicates, Mammoth keeps the last row and removes the others.
Example: to keep one row per order when an export repeats orders with different load times, choose Only specific columns and tick order_id.
Choose between a Data Check and a Checkpoint
The Controls category has two tasks. A Data Check tests data automatically. A Checkpoint tells people, or waits for a person to approve, before the pipeline goes on.
| Data Check | Checkpoint | |
|---|---|---|
| What it does | Tests your data against rules you define | Sends notifications and can pause the pipeline for human review |
| When to use it | To catch bad data before it reaches later tasks | When a person must review or approve before the pipeline continues |
| On failure or trigger | Pause the pipeline, or flag and continue | Notify only, or pause for approval |
| What else happens | Optional email on failure. Later tasks don't run while the pipeline is paused. | Email (and an optional webhook). An approval gate holds the pipeline until approved. |
| Partial rerun | Marked Bypassed if it sits before the task you rerun from | Marked Bypassed if it sits before the task you rerun from, unless it is already waiting for approval or approved |
Use a Data Check when no person needs to look (empty columns, unexpected row counts, values out of range). Use a Checkpoint when someone should review the data, your team wants a message as a key task finishes, or you need a record that a person approved the output.
For high-stakes pipelines, use both. Add a Data Check after the data comes in, then a Checkpoint before the final output so a team lead can review it before the report goes out.
Add a Data Check to a pipeline
A Data Check runs after the task before it and tests that task's output.
- Open the Transform menu and choose the Controls category.
- Select Data Check.
- Choose a check type from the tiles and set it up. See Data Check types.
- To test more rules, click Add check.
- Choose what happens if the check fails (When a Data Check fails).
- Optional: tick Notify on failure and choose recipients.
- Click Apply.
The Data Check appears in the Pipeline panel. You can have one Data Check per task position: to test several rules at the same point, use Add check inside it, not a second Data Check.
Three checks to start with
These three cover common problems. Add them after your first ingestion task:
- Row count at least 1: catches empty output from an upstream failure.
- Null percentage less than 5% on your key ID column: catches broken joins or missing source data.
- Value range on your main number column: catches sign errors, unit mix-ups or corrupt values.
Use the suggested checks for your columns
When columns in the View are marked as an ID, a percentage or a currency, the top of the form shows Suggested for your columns, with one check per column. Click Add to add one. It is prefilled, you can still edit it, and it replaces an empty check row.
| Column type | Suggested check | Check it adds |
|---|---|---|
| ID (Text or Number) | "order_id is unique" | Unique values, 100% unique (no duplicates) |
| Percentage, values between 0 and 1 | "margin is between 0 and 1" | Value range, between 0 and 1 |
| Percentage, values above 1 | "margin is between 0 and 100" | Value range, between 0 and 100 |
| Currency | "revenue is not negative" | Value range, is at least 0 |
The value range suggestions use the strictest tolerance, Fail if any row violates. A suggestion goes away once the form has the same check for that column. Columns without one of these types get no suggestions. To mark a column, see Column types, IDs, currency and percentages.
Related
- Data Check types: row count, nulls, unique values and ranges: every rule and its conditions.
- What happens when a Data Check fails: pause or flag, emails, statuses and Monitor.
- Filter rows: keep only the rows you need, or the top and bottom rows.
- Data quality report: spot nulls and duplicates before you add checks.
Something wrong? support@mammoth.io