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:
@@ -64,12 +64,22 @@ func Export(w io.Writer, d *db.DB, name string, now time.Time) error {
|
||||
for k := 0; k <= 24; k++ {
|
||||
head = append(head, fmt.Sprintf("month_%d_pct", k))
|
||||
}
|
||||
for k := 0; k <= 24; k++ {
|
||||
head = append(head, fmt.Sprintf("month_%d_mrr", k))
|
||||
}
|
||||
write(head)
|
||||
for _, c := range model.Cohorts(1000, 24) {
|
||||
row := []string{c.Month, strconv.Itoa(c.Customers), dollars(c.Start)}
|
||||
for _, r := range c.Retained {
|
||||
row = append(row, pct(r))
|
||||
}
|
||||
for _, v := range c.MRR {
|
||||
if v < 0 {
|
||||
row = append(row, "")
|
||||
} else {
|
||||
row = append(row, dollars(v))
|
||||
}
|
||||
}
|
||||
if err := write(row); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user