Skip to main content

Budget Layers

Konsolidat keeps every stakeholder's budget contribution as its own layer and sums the layers when it reads. The first submission, the finance cut, the management top-up and the board adjustment all survive as separate rows. Nothing overwrites anything.

Final budget = base + challenge + management + board, for every period.

The four layers​

LayerRole that may edit itTypical use
baseBudget Submitter (alias: Entity Accountant)The entity's own plan
challengeBudget ControllerFinance adjustments, usually cuts
managementBudget ManagerExecutive additions
boardBudget ApproverBoard-level adjustments

System Manager may edit every layer. Everyone with read access to the entity can read every layer.

Source: LAYER_ROLES and LAYER_ROLE_ALIASES in konsol/epm/doctype/budget_sheet/budget_sheet.py; VALID_LAYERS in konsol/epm/budget_grain.py.

Where a layer lives in konsol​

DoctypeOne record perHolds
Budget Cyclescenario × fiscal yearThe lock. status is Open or Locked, with locked_by and locked_on.
Budget Sheetcycle × entity × layerannual_total and the lines.
Budget Line (child table)account × budget dimensionsTwelve period columns period_01 … period_12 and annual.

The budget dimensions are the Published Dimensions ticked in_budget. konsol adds one dim_* field per such dimension to Budget Line and Budget Annual Input; no dimension is named in shipped code (konsol#287).

A Budget Cycle cannot target a scenario of type actual. Actuals come from the GL.

How a cell gets in​

PathWhat happens
Excel =K.EPMSAVE(amount, entity, year, period, account, scenarioId, layer, [dimensions], [hierarchy], [node])Calls budget_cell_save. Writes one period on one line of the (cycle, entity, layer) sheet. A refused write shows #N/A with the reason.
API budget_save / budget_save_batchOne line with a periods array. Each period carries its own layer (default base); a payload that mixes layers fans out across sheets. Only the periods you send are touched.
Frappe DeskEdit the Budget Sheet directly. The sheet checks your role against its layer.

Every path auto-creates the Budget Cycle for (scenario, fiscal year) as Open if it does not exist yet.

Locking​

The Budget Cycle is the only approval gate. There is no per-document workflow.

  1. While the cycle is Open, anyone with the right role and entity access writes cells.
  2. The manager submits the cycle. before_submit sets status = Locked, locked_by, locked_on.
  3. After the commit, every sheet of the cycle is exploded wide-to-tall into epm_gold.budget_monthly_input (one row per non-zero period; zero months are not written). If D365 write-back is enabled for the entity, the sheet is also pushed to D365 budget register entries.
  4. A write to a locked cycle is refused with HTTP 423 (_assert_cycle_open in api.py). The Budget Sheet itself and Budget Annual Input also refuse edits while the cycle is locked.
  5. Cancel the cycle to amend. Status goes back to Open and the sheet's rows are deleted from epm_gold.budget_monthly_input.

ClickHouse only receives sheet rows on lock. Until the cycle is locked and the next dbt build has run, =K.EPM_BUDGET() does not show what is on the sheets.

Concurrent edits​

budget_cell_save accepts an optional base_modified: the sheet's modified timestamp the client last read. If the sheet changed since then, the write is refused with HTTP 409 and a conflict payload (your_amount, current_amount, current_modified) so the client can refresh and ask again. Omit base_modified and the last write wins. Cells of one sheet serialise on a row lock; different (entity, layer) pairs are different sheets and do not contend.

Worked example​

Scenario BUDGET_2025 (type budget, active), entity USMF, account 6100 (an Expense account), budget dimension dim_region = EU (a dimension this example site declared in_budget).

1. The entity submits (base)​

P1P2P3P4P5P6P7P8P9P10P11P12Annual
base100,000100,000100,000100,000100,000100,000100,000100,000100,000100,000100,000100,0001,200,000

The cells land on the base Budget Sheet for USMF under the BUDGET_2025 × 2025 cycle, which is created Open on the first write.

2. Finance challenges (challenge)​

A 5% cut in every month.

P1P2P3P4P5P6P7P8P9P10P11P12Annual
challenge-5,000-5,000-5,000-5,000-5,000-5,000-5,000-5,000-5,000-5,000-5,000-5,000-60,000
Subtotal95,00095,00095,00095,00095,00095,00095,00095,00095,00095,00095,00095,0001,140,000

3. Management adds (management)​

Funding for a Q3 launch.

P7P8P9Annual
management15,00015,00010,00040,000

4. The board adds Q4 contingency (board) and the manager locks the cycle​

P10P11P12Annual
board5,0005,0005,00015,000
P1P2P3P4P5P6P7P8P9P10P11P12Annual
FINAL95,00095,00095,00095,00095,00095,000110,000110,000105,000100,000100,000100,0001,195,000

What ClickHouse receives on lock​

epm_gold.budget_monthly_input, one row per layer and non-zero month: 12 base + 12 challenge + 3 management + 3 board = 30 rows (not 48; zero months are skipped).

scenario_iddata_area_idfiscal_yearmain_accountdim_regionfiscal_periodamountlayer
BUDGET_2025USMF20256100EU7100,000base
BUDGET_2025USMF20256100EU7-5,000challenge
BUDGET_2025USMF20256100EU715,000management
BUDGET_2025USMF20256100EU105,000board
…

What dbt produces​

gold_spread_budget reads budget_monthly_input as an identity spread: each typed month is its own weight. Per layer it computes annual_amount = Σ amount and period_weight = amount / annual_amount, stamps spread_profile_id = 'manual', and keeps the layer column. For P7:

layerperiod_amountannual_amountperiod_weightspread_profile_id
base100,0001,200,000100,000 / 1,200,000 = 0.0833manual
challenge-5,000-60,000-5,000 / -60,000 = 0.0833manual
management15,00040,00015,000 / 40,000 = 0.375manual

gold_scenario_trial_balance then sums the layers to one row per (scenario, entity, year, period, account, dimensions): P1–P6 = 95,000; P7–P8 = 110,000; P9 = 105,000; P10–P12 = 100,000. gold_variance_analysis and gold_budget_at_hierarchy_node read from there and from gold_spread_budget respectively.

If a Budget Annual Input row exists at the same grain, the manual base row replaces its spread; the other manual layers add on top. See Budget Spreading.

What Excel sees​

=K.EPM_BUDGET() reads gold_spread_budget (Dataset budget_input, measure period_amount). With no layer argument it sums all layers; with one it filters to that layer.

FormulaResultArithmetic
=K.EPM_BUDGET("USMF", 2025, 5, "6100")95,000100,000 − 5,000
=K.EPM_BUDGET("USMF", 2025, 7, "6100")110,000100,000 − 5,000 + 15,000
=K.EPM_BUDGET("USMF", 2025, 10, "6100")100,000100,000 − 5,000 + 5,000
=K.EPM_BUDGET("USMF", 2025, "Q1", "6100")285,0003 × 95,000
=K.EPM_BUDGET("USMF", 2025, "Q3", "6100")325,000110,000 + 110,000 + 105,000
=K.EPM_BUDGET("USMF", 2025, "H2", "6100")625,000325,000 + 300,000
=K.EPM_BUDGET("USMF", 2025, "FY", "6100")1,195,0001,200,000 − 60,000 + 40,000 + 15,000
=K.EPM_BUDGET("USMF", 2025, 5, "6100", , , , , "challenge")-5,000the challenge layer only
=K.EPM_BUDGET("USMF", 2025, "FY", "6100", , , , , "management")40,000the management layer only

=K.EPM(entity, year, period, account, "period_amount", "budget", …, layer) is the long form of the same call.

Variance on the final budget​

Actuals for P5 come in at 92,000.

FormulaResultHow
=K.EPM("USMF", 2025, 5, "6100", "actual_amount", "variance")92,000GL
=K.EPM("USMF", 2025, 5, "6100", "budget_amount", "variance")95,000sum of layers
=K.EPM_VARIANCE("USMF", 2025, 5, "6100")-3,00092,000 − 95,000
=K.EPM("USMF", 2025, 5, "6100", "variance_pct", "variance")-3.16−3,000 / abs(95,000) × 100
=K.EPM("USMF", 2025, 5, "6100", "variance_favorable", "variance")1Expense, is_pnl = 1, actual < budget

Variance rows exist only for scenarios the site declares as type budget and active. See the Variance Analysis Guide.

End-to-end flow​

EXCEL / DESK / API KONSOL CLICKHOUSE EXCEL
────────────────── ────── ────────── ─────
=K.EPMSAVE(...) ──► budget_cell_save ──► Budget Cycle (Open)
└─ Budget Sheet (entity × layer)
└─ Budget Line (account × dims, P01..P12)
manager submits cycle ──► Locked (423 on further writes)
│ after commit, per sheet
├──► epm_gold.budget_monthly_input (one row per layer × non-zero month)
└──► D365 budget register (if enabled)
dbt build
├─ gold_spread_budget (keeps layer) ◄── =K.EPM_BUDGET(..., layer)
├─ gold_budget_at_hierarchy_node (keeps layer)
├─ gold_scenario_trial_balance (sums layers)
└─ gold_variance_analysis ◄── =K.EPM_VARIANCE(...)

Forecasts use the same path​

A Budget Cycle may target any Scenario whose type is not actual (budget, forecast, strategic, operational). Layers, sheets, lock and Excel retrieval are identical. Pass the scenario in scenarioId:

=K.EPM_BUDGET("USMF", 2025, 5, "6100", , "FORECAST_Q3")

Only scenarios of type budget reach the variance models. Forecast rows sit in gold_scenario_trial_balance but never in the variance models (assert_scenario_rows_declared documents this as by design).

Key points​

PointDetail
Layers are additiveThe sum across layers is the final budget. There is no separate "final" row.
One lockThe Budget Cycle (scenario × year) is the only gate. Locked → 423. Cancel to reopen.
Sync on lock onlySheets reach epm_gold.budget_monthly_input when the cycle locks, and leave it when the cycle is cancelled.
Zero means not budgetedZero months are not written to ClickHouse.
Layer survives into goldgold_spread_budget and gold_budget_at_hierarchy_node carry layer; gold_scenario_trial_balance sums it away.
Role per layerEach layer is locked to its role; System Manager edits all.
Dimensions are declaredBudget lines carry the in_budget Published Dimensions, whatever the site calls them.

Next steps​