Metrics: the first month counted is labelled as the existing customers
With a "Count from" month set, that month's cohort is everyone already paying then, not only those new that month. Both cohort tables now say "existing customers" under it, the help text explains, and both cohort CSVs add an existing_customers column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,7 @@ func Export(w io.Writer, d *db.DB, name string, now time.Time) error {
|
||||
for k := 0; k <= span; k++ {
|
||||
head = append(head, fmt.Sprintf("month_%d_mrr", k))
|
||||
}
|
||||
head = append(head, "existing_customers")
|
||||
write(head)
|
||||
for _, c := range model.Cohorts(len(model.Months), span) {
|
||||
row := []string{c.Month, strconv.Itoa(c.Customers), dollars(c.Start)}
|
||||
@@ -81,6 +82,7 @@ func Export(w io.Writer, d *db.DB, name string, now time.Time) error {
|
||||
row = append(row, dollars(v))
|
||||
}
|
||||
}
|
||||
row = append(row, strconv.FormatBool(c.Existing))
|
||||
if err := write(row); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -95,6 +97,7 @@ func Export(w io.Writer, d *db.DB, name string, now time.Time) error {
|
||||
for k := 0; k <= span; k++ {
|
||||
head = append(head, fmt.Sprintf("month_%d_revenue_per_customer", k))
|
||||
}
|
||||
head = append(head, "existing_customers")
|
||||
write(head)
|
||||
for _, c := range cs {
|
||||
row := []string{c.Month, strconv.Itoa(c.Customers)}
|
||||
@@ -105,6 +108,7 @@ func Export(w io.Writer, d *db.DB, name string, now time.Time) error {
|
||||
row = append(row, "")
|
||||
}
|
||||
}
|
||||
row = append(row, strconv.FormatBool(c.Existing))
|
||||
if err := write(row); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user