A retention manager sees repeat purchasing fall from 75% for May customers to 50% for June and 25% for July. The tempting response is to increase follow-up spending for July. Before changing that budget, compare customers over the same number of days after their first purchase. An older customer group has had more time to place another order, so a rate based on everything observed so far can create a misleading trend.
This worked example follows Hearthwell Home, a fictional Ecommerce store selling cushion covers, throws and table linens. It uses 42 synthetic orders and a data cutoff of September 30, 2026. Eight identifiable customers first purchased in each of May, June and July. The calculation below measures a later purchase within 90 calendar days and includes only customers whose entire window has elapsed. May reaches 62.5% and June 37.5%. July has no eligible customers at this cutoff, so its completed 90-day result is unavailable. These small fictional groups illustrate the method; their rates are not industry benchmarks.
What You Will Learn
- How do you define a qualifying repeat purchase?
- Which customers have had enough time to enter the comparison?
- How can a cohort result guide the next retention investigation?
![]()
Figure 1. Rates based on any later purchase observed by September 30 are 75%, 50% and 25%. The groups have unequal follow-up time, so these are not comparable completed 90-day results.
Define the purchasing event
A cohort groups customers by a shared starting event. Here, that event is their first qualifying recorded purchase, and the cohort label is its calendar month. Each customer belongs to one group. A purchase qualifies when its order status is Completed, its customer identifier is present and its date is on or before the cutoff. The source contains unique order identifiers, so one order occupies one row.
Two canceled orders and one completed guest order with no customer identifier are excluded. That leaves 39 qualifying order rows belonging to 24 customers. A cancellation before a completed purchase does not start a customer’s window. The unidentified guest order remains an explicit exclusion rather than becoming an invented customer.
For this example, a repeat means a separate qualifying order on a later calendar date, within 90 days of the first qualifying order. An additional order on the same day does not qualify. This is a deliberate date-based definition; a business needing same-day repeat behavior would require timestamps and a different event rule. Customers with several later orders count once in the numerator.
The supplied synthetic history includes every qualifying earlier purchase for these customers. A real export may begin after an established customer has already bought. In that case, label the event first observed purchase or obtain the earlier history before describing the customer as newly acquired. Stable account identifiers also need scrutiny when accounts merge or shoppers use several accounts.
A later refund does not erase a completed purchasing event in this behavioral definition. Therefore, this rate describes repeat purchasing rather than retained revenue or profitable customers. A return-adjusted commercial measure needs its own policy and calculation.
Give each customer the full observation window
Calculate the window end by adding 90 calendar days to the first qualifying purchase date. Include a later order dated after the first purchase and on or before that end date. Treat September 30 as an inclusive cutoff for the source’s calendar dates; this example performs no timestamp or timezone conversion. For timestamped international orders, agree one business timezone before deriving calendar dates, then test orders around midnight. Changing that convention can change a first-purchase day and its window end.
Customer C001 first bought on May 1. Its window ends July 30, and an order on July 30 qualifies. C006 first bought May 22; its later order on August 21 falls on day 91 and does not qualify for this measure. Ninety days is a specified elapsed period, not an instruction to add three calendar months.
A customer becomes eligible when the window end is on or before the cutoff. All eight May customers and all eight June customers qualify. The latest first purchase in June is June 28, whose window ends September 26. July’s first purchases run from July 5 to July 28; none has completed 90 days by September 30.
![]()
Figure 2. The latest first purchases in May and June have 90-day endpoints before the cutoff. July’s endpoints extend beyond September 30, leaving its completed-window comparison unavailable.
Build one row per customer
Start from qualifying orders and group them by customer identifier. Take the earliest qualifying date, derive its cohort month and calculate the window end. Find whether at least one later qualifying order falls inside the window. Keep eligibility separate from the observed repeat flag: an immature customer’s lack of a repeat today is not a final negative outcome.
The calculation rules are:
Window end = first qualifying purchase date + 90 days
Eligible = window end is on or before the cutoff
Observed repeat = a qualifying order after the first date and on or before window end
Rate = eligible customers with an observed repeat / eligible customers
The accompanying customer calculation CSV exposes the intermediate dates and flags. Its summary CSV reports the matching customer counts. These are static calculations for the supplied cutoff, so changing the raw order CSV alone does not refresh the derived files. Rebuild the customer calculation and summary when adding orders or changing the cutoff. In production, configure a scheduled database job or report refresh to recalculate customer eligibility and cohort totals together from one cutoff parameter.
Keep the source orders separate from the customer table. Joining every later order back to a customer summary can create several copies of that customer. If a chart then counts rows, a frequent buyer receives more weight than someone who ordered once. Confirm that the customer table still has 24 unique identifiers after any enrichment, and use the customer indicator rather than the number of later orders for the numerator. In SQL, use COUNT(DISTINCT customer_id) for unique customers after enrichment. Count eligible repeat purchasers only where Eligible90=1 AND RepeatWithin90=1, and retain the eligibility filter in the denominator.
For a larger operational dataset, the data analytics task is to establish reliable customer identifiers and repeat-purchase definitions before choosing a reporting layer. Ecommerce analytics consulting and Power BI consulting can support that work; data visualization consulting can help show cohort counts, observation windows and unavailable results clearly. Every measure still needs traceable orders, a coverage cutoff and a decision owner.
If a customer has not yet returned and the window is still open, the final outcome is unresolved. NIST’s explanation of right-censored observations describes an event that has not been observed before follow-up ends. Here, waiting for the complete window keeps that unresolved outcome out of the comparison.
Reconcile selected customers to their original orders before trusting the chart. C001 has two later orders within its window but contributes one repeat customer. C006 contributes none to the 90-day numerator, even though its day-91 order makes it a repeat purchaser under the unrestricted observed measure. C009’s June 1 purchase followed by an August 30 order tests the inclusive day-90 boundary again.
Apply the same care to customer identity when comparing this sales cohort with a website cohort. Google Analytics’ cohort documentation separates inclusion and return criteria, but its cohorts use device data rather than User-ID. This calculation follows the supplied customer identifiers. Check which identities and purchasing events each report counts before comparing their results.
![]()
Figure 3. A later order on day 90 is included; day 91 is excluded. C001 and C009 test the included boundary, while C006 and C012 test the excluded boundary.
Check the cohort results
Five of May’s eight eligible customers purchased again within 90 days: 5 divided by 8 gives 62.5%. Three of June’s eight did so: 3 divided by 8 gives 37.5%. June is 25 percentage points lower. That difference represents two customers in this deliberately small example; one customer’s outcome changes either group’s rate by 12.5 percentage points.
The earlier unrestricted figures included six May repeat purchasers and four June repeat purchasers. One customer in each group bought again only after day 90, explaining why those figures were higher. Before publishing, reconcile the customer file to 24 unique customers, 16 eligible customers and eight eligible repeat purchasers. Summing RepeatWithin90 without filtering Eligible90=1 returns ten because it includes July’s two observed repeats. Check that the summary agrees with the eligible totals. July has zero eligible customers for the completed-window calculation, so its result is unavailable. A zero denominator is not a measured 0% repeat-purchase rate.
Show cohort size, eligible customer count, repeat customer count, horizon and cutoff beside the rate. If only an early part of a month has matured in another dataset, identify the result as a partial eligible population or wait for the full cohort. Early-month purchasers may differ from the remainder; a partial result should not silently acquire the label of a complete monthly cohort.
![]()
Figure 4. The completed 90-day rates are 62.5% for May and 37.5% for June. July has no eligible customers and is labeled unavailable rather than drawn as a zero-rate bar.
Choose the next investigation
The mature comparison gives the manager a specific question: what differs between the May and June purchasing groups? Inspect first-purchase category, acquisition source and the timing of follow-up messages. Those descriptors are not in the supplied order file; obtain product, acquisition and message records before comparing those segments. Keep the cohort rule unchanged while examining those differences, and retain customer counts when breaking the small groups into smaller segments.
These descriptive groups do not establish that a campaign caused the difference. A useful next step is to inspect selected customer journeys and then plan a prospective comparison with a defined audience, message and outcome window. Monitor commercial outcomes such as returns and contribution separately before deciding that additional repeat purchasing justifies the campaign’s cost.
Agree on the intended response before the next review. A service problem might call for investigating delivery or support experiences; a product mismatch might require examining the first purchase. The cohort rate locates a group worth understanding, but it does not identify the remedy. Assign the investigation to someone who can inspect the underlying records and explain what additional evidence would change the proposed action.
If the business needs an earlier view of July, choose a shorter horizon explicitly. All three groups have completed 30 days in this dataset. The 30-day counts are two of eight for May and one of eight for both June and July, giving 25%, 12.5% and 12.5%. Those figures answer a 30-day question; they cannot be relabeled as completed 90-day results.
Keep the comparison current
Preserve the event definition, customer identity rule, date coverage, horizon and cutoff with each release. Record exclusions and show the customer-level dates behind the cohort summary. Once the data coverage and cutoff advance, an immature window can become eligible. Late status corrections or identity repairs can alter earlier results. Rebuild the dependent calculations and check affected customers before replacing the published rates.
For the present decision, May and June provide the complete 90-day comparison. July remains a group to follow as its window matures. That distinction lets the manager investigate the observed difference without treating a customer’s shorter opportunity to return as evidence of declining loyalty.
Charts created by Data Pivot Consulting. Used with permission.