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:
- Attainment —
closed_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.
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:There is a dedicated field.
src/objects/forecast.object.tsdeclares:It is surfaced too —
attainment_pctis a column on both theall_forecastsandthis_quarter_forecastslist views, andcoverage_rationext 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_pctis per row and expressed as a percentage 0–100;forecast_metricsdataset'sattainmentmeasure isratio(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 insrc/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.