Forecast · Assess & Decide · Analysis & Finance
Weighted sales forecast from your pipeline
A weighted, discount-adjusted forecast: each deal weighted by its stage probability and rolled up by month.
You receive: A reviewed forecast calculator + the passing test report, run on your pipeline.
Part of Choose Business Model, Build a Sales Engine
Opens soon
Cost20 credits
AcceptanceAutomated check against your inputs
ProtectionHeld until verified delivery
This objective is verified and ready. It opens soon, once sign-in and payments are live.
Deliverable interface
The exact vocabulary the automated check enforces: keys, tokens, entry points, and worked examples. Generated from the verification source.
{
"constants": {},
"entryName": "compute_weighted_forecast",
"expectNote": "expect is the comparison-space value (your return value goes through normalize first when one is published)",
"hiddenCaseCount": 10,
"hiddenCaseNames": [
"single_half_discount",
"multi_month_rollup",
"explicit_probability_overrides",
"unknown_stage_zero",
"rounding_to_the_cent",
"full_discount_zeros",
"live_full_value",
"empty_pipeline",
"zero_deal_size",
"months_sorted_ascending"
],
"inputKeys": [
"close_month",
"deal_size",
"discounted_value",
"name",
"opportunities",
"optimism_discount",
"stage",
"stage_ladder",
"stage_probability"
],
"normalizeSource": "def _forecast_normalize(r):\n try:\n per = [{\"name\": str(p[\"name\"]), \"weighted_value\": round(float(p[\"weighted_value\"]), 2),\n \"discounted_value\": round(float(p[\"discounted_value\"]), 2), \"close_month\": str(p[\"close_month\"])}\n for p in r[\"per_opportunity\"]]\n months = [{\"month\": str(m[\"month\"]), \"discounted_value\": round(float(m[\"discounted_value\"]), 2)}\n for m in r[\"by_month\"]]\n dist = {str(k): int(v) for k, v in (r[\"stage_distribution\"] or {}).items()}\n return {\"per_opportunity\": per, \"discounted_total\": round(float(r[\"discounted_total\"]), 2),\n \"by_month\": months, \"stage_distribution\": dist}\n except Exception:\n return repr(r)\n",
"returnShapes": [
[
"by_month",
"discounted_total",
"per_opportunity",
"stage_distribution"
]
],
"signature": "def compute_weighted_forecast(inp):",
"submission": "python exposing the entry function; inp is one input object; graded on held-out cases",
"tier": "calculator",
"visibleCases": [
{
"expect": {
"by_month": [
{
"discounted_value": 500,
"month": "2026-07"
}
],
"discounted_total": 500,
"per_opportunity": [
{
"close_month": "2026-07",
"discounted_value": 500,
"name": "Acme",
"weighted_value": 500
}
],
"stage_distribution": {
"great demo": 1
}
},
"input": {
"opportunities": [
{
"close_month": "2026-07",
"deal_size": 1000,
"name": "Acme",
"stage": "great demo"
}
],
"optimism_discount": 0,
"stage_ladder": {
"demo scheduled": 0.1,
"good demo": 0.25,
"great demo": 0.5,
"live": 1,
"signed": 0.9,
"verbal commitment": 0.75
}
},
"name": "single_no_discount"
}
],
"vocabulary": [
"by_month",
"close_month",
"deal_size",
"discounted_total",
"discounted_value",
"month",
"name",
"opportunities",
"optimism_discount",
"per_opportunity",
"stage",
"stage_distribution",
"stage_ladder",
"stage_probability",
"unknown",
"weighted_value"
]
}Get early access to STUD the day it goes live.