Skip to content
Learn › Clean and shape data: open the docs menu

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

Remove Duplicate Rows panel with the Evaluate duplicates from menu open: All columns, All columns except, Only specific
  1. Select Filter, Label & Replace > Remove Duplicate Rows.
  2. In Evaluate duplicates from, choose which columns must match for two rows to count as duplicates (see the table).
  3. Tick the columns to leave out or to compare, if your choice asks for them.
  4. Click Apply.
Evaluate duplicates fromA row is a duplicate when
All columnsEvery column value matches exactly
All columns, exceptEvery column matches apart from the ones you tick. Use it when timestamps or auto-generated IDs differ between otherwise identical records.
Only specific columnsThe 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.

Transform menu open on the Controls category, listing Data Check and Checkpoint
Data CheckCheckpoint
What it doesTests your data against rules you defineSends notifications and can pause the pipeline for human review
When to use itTo catch bad data before it reaches later tasksWhen a person must review or approve before the pipeline continues
On failure or triggerPause the pipeline, or flag and continueNotify only, or pause for approval
What else happensOptional 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 rerunMarked Bypassed if it sits before the task you rerun fromMarked 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.

Data Check panel with a Row count check row, the If check fails choice set to Pause the pipeline, and a Notify on failure checkbox
  1. Open the Transform menu and choose the Controls category.
  2. Select Data Check.
  3. Choose a check type from the tiles and set it up. See Data Check types.
  4. To test more rules, click Add check.
  5. Choose what happens if the check fails (When a Data Check fails).
  6. Optional: tick Notify on failure and choose recipients.
  7. 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 typeSuggested checkCheck 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.

Was this page helpful?

Something wrong? support@mammoth.io