Start from the visible target
Inspect the saved table, and copy the returned row or column reference intoedit_table_blocks:
- Use a row or a column for a formula that applies along that axis.
- Use a cell for one exact visible result.
Write a condition
When you write a condition yourself, use the readable Dimension and item names that inspection returns. Put backticks around names with spaces, and add a returned reference’s short suffix only when needed.
A condition with no Date term, such as
[], can supply inherited defaults in both Actuals and Forecast.
Exact and inheriting conditions
A condition without$ can still match a richer cell address. A condition that begins with $ matches exactly the set of Dimensions it names:
- A
cell_updatesentry saves one exact formula per selected cell, so one row across 60 period columns saves 60 formulas, andclear_formularemoves them. - A
row_updatesentry’sdefault_formulassaves one inheriting formula that covers every period in its range. - On a timeless row with one value column, the cell’s coordinates are the row’s own, so the edit writes or removes the row’s formula.
$ belongs to the condition grammar. In an expression, an absolute reference puts $ after the Variable’s name instead: Revenue$[Department = "Sales"].
Use exact scope only when the user intends that narrower behavior. A formula that leaves out Date cannot fill dated cells when it matches only its exact set of Dimensions.
How results describe a formula’s reach
Formula reads and write receipts describe each saved default’s scope the same way:- its condition and its range;
- its Date grain, when the formula is dated:
time_grainin a read,Date grain: <grain>in a receipt; - its reach in words.
includes additional dimensionsmeans an inheriting[...]condition that also covers cells carrying more business Dimensions, at the same Date grain.this grain onlymeans an exact$[...]condition.
Actuals and Forecast ranges
Formula ranges separate parts of the timeline that use different calculations. Actuals and Forecast are defined relative to a Scenario’s Last close, and each Scenario has its own. Interpret a formula range against the boundary of the Scenario you read or write: the onescenario names, or the Scenario in view when the call leaves scenario out.
Let the visible target choose the range
When the formula belongs to a visible row, column, or cell, inspect the saved table and useedit_table_blocks to target the actual result. The server derives the formula range from the target, so you do not invent or fetch a formula-range ID.
Dated formulas need Date at the base grain
A formula for Actuals or Forecast needs Date in its condition, at the Model’s base grain. In a monthly Model:default_formulas.actuals or default_formulas.forecast on a row or a column, or in a variables entry of edit_table_blocks. A formula saved through a variables entry, with no table named, gets one Date term at the Model’s base grain automatically.
Read Last close when it matters
Every tableread returns the Scenario’s calendar: last_close, its default granularity, and its default range. Read it when you need to confirm Last close, because the boundary decides which dates count as Actuals and which belong to Forecast. edit_table_blocks update_calendar changes these settings for the Scenario; every table in the Scenario shares them.
If the Scenario has no Last close, explain the missing setting before you build a result that depends on the range.