Problems / Repeat Purchase Rate / Editorial
GROUP BY customer_id
COUNT(*)
FILTER
SUM(CASE WHEN order_count >= 2 ...)
100.0
Rates about *customers* cannot be computed directly from a table of *orders* — the grain is wrong. The two-step shape (per-entity aggregate, then a summary over entities) is the standard fix, and it is worth recognizing on sight: retention, repeat rate, and power-user metrics are all "aggregate of an aggregate" problems.
Solve Repeat Purchase Rate yourself →