Field note · July 14, 2023

Reading revenue_usd before trusting it in ab-test-checkout

6,000 rows, 603 distinct values, and the one fact about revenue_usd that changes how you query it.

1 min read ·Data quality ·quality practice

Profiling revenue_usd on ab-test-checkout before anyone builds anything on top of it.

6,000 rows, no nulls, 603 distinct values. Revenue attributed to the user. Zero if not converted.

The five-number version: min 0.00, p10 0.00, median 0.00, p90 13.25, max 396.58. The mean is 6.92.

The p10 to p90 band — 0.00 to 13.25 — is where ordinary rows live, and it is the pair worth quoting when somebody asks what to expect. Min and max describe the two strangest rows in the table and nothing else; they are useful for spotting impossible values and misleading for everything else.

sql
select
  count(*)                      as rows,
  count(revenue_usd)            as present,
  count(*) - count(revenue_usd) as nulls,
  count(distinct revenue_usd)   as distinct_values
from ab_test_checkout;

5,383 rows are exactly zero — 89.7% of the column. Decide what a zero means here before you average anything, because "did not happen" and "measured zero" do not belong in the same denominator.

Where this bites: the two populations move independently. A drop in the overall average could be fewer non-zero rows or smaller non-zero values, and one number cannot tell you which — so the reporting version is usually a rate and a size rather than a mean.

The grain is one row per exposed user, which is the context every one of those numbers depends on. None of them survive a change of grain, which is why "profile the column" and "profile the table" are the same job. Full schema, and the CSV, on the dataset page.