HAMMAD YOUSUF

FREE RESOURCE · FROM THE "CHECK" REEL

AI dashboard data check: the audit prompt and a practice kit for the duplicate order trap

By · 1 November 2026

A polished dashboard can carry a wrong total. In the reel's sample, one duplicated order turns AED 12,000 into AED 15,000. Audit source data before creating charts. This page gives you the prompt and a practice file to try it on.

At a glance · fictional practice data

Practice file
7 rows, AED 15,000, one order per row
The trap
Order O-1003 (AED 3,000) appears twice, identical in every field
Clean file
6 rows, AED 12,000
Date window
1 to 6 October 2026
The CHECK reel: a polished dashboard with the wrong total, then the audit that fixes it. Watch on Instagram

The audit prompt

Paste it with the CSV into Claude, ChatGPT or any assistant your team has approved for data. It audits first and only touches the practice file.

Audit before charts

prompt
Audit this CSV before making a dashboard. Do not alter the original. First state the unit of a row and the date/currency assumptions. For this practice file, each row is a complete order, not a line item. Flag repeated order IDs and distinguish exact duplicate rows from conflicting records. Show row numbers and the amounts affected. Do not delete repeated IDs automatically: explain why an exact row is a duplicate and ask before changing real data. Never merge currencies or guess exchange rates. Check missing values, numeric parsing and the date window. For the included sample only, remove the exact duplicate after review, save cleaned-orders.csv and reconcile original total minus removed amount equals cleaned total. Produce an audit log and a simple dashboard from the cleaned file. Show currency, date range, row count and assumptions. If anything cannot be verified, say so. Keep real customer data private and use an approved tool.

What the audit does, in five steps

  1. Read seven sample rows: AED 15,000, including one exact duplicate order of AED 3,000.
  2. Flag repeated order O-1003 and compare all fields.
  3. Verify one order per row, AED currency and 1–6 October 2026 window.
  4. Review the exact duplicate, retain six original orders, reconcile AED 15,000 minus AED 3,000 equals AED 12,000.
  5. Build the dashboard using the checked six-row file.

The practice kit

Three blocks: the orders file, a Python audit that uses only the standard library, and the log it should print. Save the first two, run the script, compare with the third.

1. The orders file

Save it as orders.csv. The second O-1003 line (row 6, counting the header as row 1) is an exact duplicate of the first: same order ID, date, customer and amount.

orders.csv (fictional practice data)
order_id,order_date,customer,currency,amount
O-1001,2026-10-01,Al Noor Trading,AED,2500
O-1002,2026-10-02,Marina Prints,AED,1800
O-1003,2026-10-03,Falcon Events,AED,3000
O-1004,2026-10-04,Desert Bloom Cafe,AED,1200
O-1003,2026-10-03,Falcon Events,AED,3000
O-1005,2026-10-05,Blue Harbour Clinic,AED,2000
O-1006,2026-10-06,Sahara Fitness,AED,1500

2. The audit script

Run python3 audit.py orders.csv. It changes nothing: it prints the audit log and, only when you pass --write, saves cleaned-orders.csv.

audit.py
import csv, sys
from collections import Counter

path = sys.argv[1]
write = "--write" in sys.argv
rows = list(csv.DictReader(open(path, newline="")))

# 1. Unit of a row and assumptions, stated before any number.
print("Assumption: each row is one complete order (not a line item).")
currencies = {r["currency"] for r in rows}
dates = sorted(r["order_date"] for r in rows)
print(f"Currency: {', '.join(sorted(currencies))}. Date window: {dates[0]} to {dates[-1]}.")
if len(currencies) != 1:
    sys.exit("STOP: more than one currency. Never merge or guess exchange rates.")

# 2. Parse amounts; fail loudly on blanks or text.
for i, r in enumerate(rows, start=2):
    try:
        r["amount"] = float(r["amount"])
    except ValueError:
        sys.exit(f"STOP: row {i} amount is not a number: {r['amount']!r}")

original_total = sum(r["amount"] for r in rows)
print(f"Rows: {len(rows)}. Original total: {currencies.pop()} {original_total:,.0f}.")

# 3. Repeated IDs: exact duplicates vs conflicting records.
by_id = Counter(r["order_id"] for r in rows)
exact, conflicting = [], []
seen = {}
for i, r in enumerate(rows, start=2):
    key = tuple(r.values())
    if r["order_id"] in seen:
        (exact if seen[r["order_id"]] == key else conflicting).append((i, r))
    else:
        seen[r["order_id"]] = key
for i, r in exact:
    print(f"EXACT DUPLICATE: row {i}, {r['order_id']}, amount {r['amount']:,.0f} (identical in every field).")
for i, r in conflicting:
    print(f"CONFLICT: row {i}, {r['order_id']} repeats with different fields. Review by hand; do not delete.")
print(f"Repeated IDs: {[k for k, n in by_id.items() if n > 1] or 'none'}.")

# 4. Reconcile. Only exact duplicates are removed, and only on --write.
removed = sum(r["amount"] for _, r in exact)
kept = [r for i, r in enumerate(rows, start=2) if i not in {i for i, _ in exact}]
cleaned_total = sum(r["amount"] for r in kept)
print(f"Reconcile: {original_total:,.0f} - {removed:,.0f} = {cleaned_total:,.0f} "
      f"({'OK' if original_total - removed == cleaned_total else 'MISMATCH'}). Clean rows: {len(kept)}.")

if write and exact and not conflicting:
    with open("cleaned-orders.csv", "w", newline="") as f:
        w = csv.DictWriter(f, fieldnames=rows[0].keys())
        w.writeheader()
        w.writerows(kept)
    print("Wrote cleaned-orders.csv. The original was not changed.")

3. The audit log it prints

audit log (expected output)
Assumption: each row is one complete order (not a line item).
Currency: AED. Date window: 2026-10-01 to 2026-10-06.
Rows: 7. Original total: AED 15,000.
EXACT DUPLICATE: row 6, O-1003, amount 3,000 (identical in every field).
Repeated IDs: ['O-1003'].
Reconcile: 15,000 - 3,000 = 12,000 (OK). Clean rows: 6.

Reconcile

AED 15,000 − AED 3,000 = AED 12,000

Original total minus the removed duplicate equals the cleaned total. Only now build the dashboard, from the six-row cleaned-orders.csv, and show the currency, the date range, the row count and the assumptions next to the chart.

The rules, in the order the audit applies them

  1. State the unit of a row first

    In this practice file each row is a complete order. In real exports a row is often a line item, so the same order ID can repeat legitimately. Decide which before you count anything.

  2. Repeated IDs are a flag, not proof

    Compare every field. Identical rows are an exact duplicate; rows that share an ID but differ are a conflict that needs a human, not a delete.

  3. Confirm currency and date range

    Never merge currencies or guess exchange rates. Check the window matches what the dashboard claims to show.

  4. Preserve the original

    Write the cleaned file next to it; never overwrite the source you are reconciling against.

  5. Reconcile before you chart

    Original total minus the removed amount must equal the cleaned total. Here: AED 15,000 minus AED 3,000 equals AED 12,000. Only then build the dashboard from the six-row file.

Common questions

Why did the dashboard in the reel show AED 15,000 instead of AED 12,000?

One order, O-1003 for AED 3,000, appeared twice in the seven-row file and the chart summed every row. Six unique orders total AED 12,000. The data is sample data, not client results.

Should I delete every repeated order ID?

No. Repeated IDs require review, not blind deletion. In real line-item data one order ID can legitimately appear on several rows. Only an exact duplicate, identical in every field, is removed, and only after you have looked at it.

Can I use the prompt on real customer data?

The prompt tells the assistant to ask before changing real data and to keep customer data private. Use an approved tool for anything that is not the practice file, and keep the original untouched.

Why a Python script when a spreadsheet can remove duplicates?

Spreadsheet duplicate detection depends on the columns you select, and it removes rows in place. The script prints what it found, reconciles the totals and only writes a separate cleaned file when you ask it to. Either tool works if you review first and preserve the original.

Where do the numbers on this page come from?

The totals, the duplicate order and the date window are the reel's. The practice file's other five rows are fictional values chosen so that the file adds up to those totals; nothing here is a real client's data.

Sources checked

  • Duplicate detection depends on selected columns; preserve original data and review before removal.. Source ↗

About the video: the reel that sent you here is presented by an AI avatar of Hammad Yousuf. The data in it is sample data, not client results.

Keep going