By Michael Nocito, data analyst · Published August 8, 2026
By the end of this page you can turn a table of transactions into named customer groups, count and total each group, cross two segmentations into a matrix, choose between cut-offs you picked and cut-offs the data picked, and prove that every customer landed in exactly one group. It is about twenty-five minutes, and every query and result below was run.
Here is what to do today, on the segmentation you already have. Count the customers in each segment and add them up. If the total is less than your customer count, some rows fell through the conditions and are sitting in a null segment nobody looks at. If any segment has zero customers, the conditions are in the wrong order.
The short version: aggregate to one row per customer, add a CASE expression that names the group, then group by that name.
Label first, group second, is the idea, so it gets the picture.






