budget_breakdown
Break down NYC capital project total budget or spend by managing agency or category, with optional agency scope and role-aware attribution.
Instructions
Total budget / spend by managing_agency or category, deduped on (fms_id,
managing_agency). Category is line-grain (additive). Optional agency scopes to one
agency; agency_role ('auto'|'sponsor'|'managing') picks owner vs builder lens. For
richer cuts use run_sql.
Interpretation rules:
[grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.
[period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.
[agency_roles] Agency attribution is role-aware: an agency's projects mean its sponsor (owner) view, except DDC/DCAS/EDC default to managing (builder). State the returned agency_scope. managing_agency is the executor on schedules and the budget-holder on budgets; a budget-only holder is not a schedule executor. list_agencies exposes is_schedule_executor. For sponsor-scoped budget totals, use a semi-join to fms_sponsor; a value-bearing join can multiply lines. Co-owner totals can overlap and must not be added together.
[categories] Classify with the curated category_dim, not project-name searches: specific ten-year labels/FMS prefixes precede sponsor routing, then generic facility keywords and Other. Categories key on (managing_agency, fms_id); institution owner rules can use all-history ownership. Schedule category_scope='current' uses each PID's current funding links; 'all_history' includes former links. A PID can count in multiple categories, so schedule category counts are non-additive; each budget line has one category.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agency | No | ||
| metric | No | total_budget | |
| period | No | current | |
| group_by | No | managing_agency | |
| agency_role | No | auto |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groups | Yes | ||
| metric | Yes | ||
| period | Yes | ||
| provenance | Yes | ||
| interpretation_rules | Yes |