Coming next: The Second Factory →

Back to Library
Data Foundations⚠️ Pitfall

Cleaning the Same Dates Every Morning (When Every Query Fixes Raw Data Again)

The Problem

Every query starts the same way: fix the dates. Then the time zones. Then turn the money from text into numbers, and decide what "N/A" means this time. Five analysts do it five slightly different ways. One converts to Eastern, one leaves it in UTC. One treats a blank as zero, one drops the row. Each fix is reasonable. Together they're why two dashboards built from the same data never match. Nobody owns the cleaning, so everybody does it, every morning, forever.

The Principle

Clean it once, at the door. Between raw and everything else, add one layer whose only job is formats: dates, time zones, money, numbers, yes and no, blanks, codes and addresses, each written one standard way. Call it cleaned raw. Most teams call it bronze. Format, not meaning. This layer changes how the data is written, never what it says. No business rules, no joins across systems, no dropped rows: flag the test accounts, don't delete them. Same rows in, same rows out. And name every column in full words, so anyone who opens the table can read it without a lookup. Store dates the same way everywhere, keep timestamps in one time zone, and keep money in whole cents. A thousand tiny decisions disappear, and every query after this one starts from the same place.

🎯

3 Steps to Take Action

  1. 1

    Find the cleanup everyone repeats

    Pull a month of query logs and look for the same fixes showing up again and again: date parsing, time zone conversion, text to number, blanks to zero. The most-repeated fix goes first.

  2. 2

    Write the format standard on one page

    Dates, time zones, money, numbers, yes and no, blanks, codes, addresses: one standard way each, and column names in full words. Get the people who build the data and the people who use it to agree before you build anything.

  3. 3

    Build cleaned raw, then delete the fixes downstream

    One cleaned raw table per source, same rows as raw, tested so a new format gets caught before a dashboard sees it. Then take the old cleanup out of the queries, one at a time, and check the numbers still match.

💡 Inspired By

The essay "People and Systems Over Solutions" in The Auction Block, and Brian Cariveau’s talks on data layers.

This is what Analytics Pitfalls & Principles is about: people helping people.

In Practice

A support team ran three call systems. Every report on handle time began with forty lines of the same cleanup: one system logged local time, one logged UTC, one logged seconds as text. Three analysts wrote it three ways, and the weekly numbers were off by as much as an hour depending on whose query ran. They moved the cleanup into one cleaned raw table per system. Same rows as raw, every timestamp in UTC with the original kept beside it, durations as whole seconds. The forty lines came out of every report. The numbers matched the first week, and the next new analyst never had to learn the cleanup at all.

Take it to work

Give this card to your AI

A skill is a file your AI keeps. Add this one and it knows Cleaning the Same Dates Every Morning whenever your work runs into it. If it needs to know your situation, it asks first, a question and not a form, so the answer fits your company.

Then ask it: “Does my plan fall into Cleaning the Same Dates Every Morning?”

How to add it
  • Claude (a paid plan): Customize, Skills, +, Upload a skill. Pick the file you downloaded.
  • ChatGPT or Gemini: where your plan has Skills, upload the same file.
  • Microsoft 365 Copilot Cowork: Plugins, Add, Upload, then pick the Cowork file.
  • An AI at work that won’t take a skill? Open this card as text and paste it in.

All the AI skills, including ones for the moment before an AI, data or BI strategy, a dashboard or a readout goes out.

More on Data Foundations

From the book

In the book, a new hire takes six months to become useful, mostly because of table names nobody can read. And there are five definitions of an active seller.

This card is one of 62 drawn from The Auction Block by Brian Cariveau — the story of an analytics leader with 90 days to fix what the cards describe.

Heard something like this at work? See the pitfalls behind what else you’ve heard this month.Heard at work: free, 1 minute, no account