By Michael Nocito, data analyst · Published August 8, 2026
By the end of this page you can put every customer into the month they arrived, measure how many of each arrival group come back in each later month, build the triangle that shows it, and say precisely which of two reasonable definitions of "retained" your number uses. It is about twenty-five minutes, and every query and result below was run.
Here is what to do today, before writing any of it. Write down what one row of your finished table will mean, in a sentence with two dates in it: "of the customers whose first purchase was in month X, this many bought again in month Y." Everything on this page is that sentence turned into SQL, and most retention numbers that turn out to be wrong were wrong in the sentence.
The short version: tag every customer with their first month, tag every event with how many months after that it happened, then count distinct customers per pair.
The shape you are heading for is the idea, so it gets the picture.












