Skip to content

Forecasting guide says attainment has "no dedicated field", but crm_forecast.attainment_pct is one #627

Description

@os-zhuang

Found while implementing #614. Unrelated to that fix, so filed rather than fixed in the PR.

The problem

content/docs/sales/forecasting.mdx, under What you do with them:

  • Attainmentclosed_amount / quota is computed in the report layer; no dedicated field.

There is a dedicated field. src/objects/forecast.object.ts declares:

attainment_pct: Field.formula({
  label: 'Attainment %',
  description: '(Closed / Quota) * 100. Negative quota guarded.',
  expression: F`coalesce(record.quota, 0) > 0 ? (coalesce(record.closed_amount, 0) * 100.0) / record.quota : 0.0`,
  scale: 2,
}),

It is surfaced too — attainment_pct is a column on both the all_forecasts and this_quarter_forecasts list views, and coverage_ratio next to it is the same shape.

So an admin reading the guide is told to build attainment in a report when the object already computes it per row, and is not told the divide-by-zero guard exists (quota 0 or null yields 0.0, not an error).

Two things also worth stating while that bullet is being rewritten, because they are the reason the object-level field and the dataset measure are NOT the same number:

  • attainment_pct is per row and expressed as a percentage 0–100;
  • the forecast_metrics dataset's attainment measure is ratio(closed_sum, quota_sum) — a 0–1 ratio computed by summing numerator and denominator first, deliberately, so a group of reps is weighted by quota size rather than being an average of per-row percentages (the reasoning is in src/datasets/forecast.dataset.ts).

Suggested fix

Rewrite the bullet to say attainment is a stored formula field on every snapshot, note the zero-quota guard, and say that roll-ups across reps use the dataset's quota-weighted ratio rather than averaging the per-row percentage. Docs-only; no source change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationprio:p2Triaged backlog — no near-term schedule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions