05. Handling Outliers: Winsorization in SQL

A single bulk order or a single data-entry error can move a mean-based revenue metric more than the actual treatment effect does. Winsorization — capping extreme values at a percentile threshold rather than deleting them — is the standard fix, and it's a pure SQL window-function computation once the percentile itself is defined correctly.

Why One Row Can Wreck a Mean

Revenue-style metrics are usually heavily right-skewed...

💎

Premium membership required

Upgrade to premium to access the full chapter.