Metrics: cohorts show each month's dollars beside the percentage

Each cohort cell now gives what the same customers pay that month, in
dollars, under the share of their starting MRR. The cohorts CSV adds
month_N_mrr columns after the month_N_pct ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 12:58:38 -07:00
co-authored by Claude Opus 5.5
parent 06b17b9eab
commit ea94324c3b
4 changed files with 22 additions and 5 deletions
+6 -3
View File
@@ -355,14 +355,15 @@ func (m *Model) Recent(n int) []Month {
return out
}
// Cohort is the customers who first paid in one month, and the share of
// their starting MRR they pay in each month after (net revenue retention by
// cohort).
// Cohort is the customers who first paid in one month, and what those same
// customers pay in each month after: in dollars, and as a share of their
// starting MRR (net revenue retention by cohort).
type Cohort struct {
Month string
Customers int
Start float64 // their MRR in their first month
Retained []float64 // percent of Start, for month 0, 1, 2…; -1 beyond today
MRR []float64 // their MRR, in cents, for month 0, 1, 2…; -1 beyond today
}
// Cohorts are the last n signup cohorts, newest first, each followed for up
@@ -390,6 +391,7 @@ func (m *Model) Cohorts(n, span int) []Cohort {
for k := 0; k <= span; k++ {
if i+k >= len(m.Months) || co.Start == 0 {
co.Retained = append(co.Retained, -1)
co.MRR = append(co.MRR, -1)
continue
}
kept := 0.0
@@ -397,6 +399,7 @@ func (m *Model) Cohorts(n, span int) []Cohort {
kept += m.Months[i+k].ByCustomer[c]
}
co.Retained = append(co.Retained, 100*kept/co.Start)
co.MRR = append(co.MRR, kept)
}
out = append(out, co)
}