Show published records and breakdowns
For accounts, cashflows and numeric metrics over time, select those existing results directly with RecordTable({series:[{source:bank,label:"Cash"}],period:"years"}) or the same options on RecordChart. No extra published calculation is needed. See native financial series for sampled percentiles, date and age axes, and selected-year rows.
Publish a calculation when its structured results should be available in the presentation and saved calculation. Add publish: true to its declaration. Keep amounts as Money when currency matters; a plain number does not acquire the application's currency. An optional unit describes numeric values such as people or items.
Record rows
For a published record whose keys identify rows, select the fields to display:
budget: RecordTable({
source: budget.outputs.rows,
columns: [
{ key: "standard", label: "Reference amount" },
{ key: "actual", label: "Actual amount" }
],
labels: { food: "Food" }
})The source must be an actual published calculation or projection, or a sampled source wrapper around one. results.calculation("compiledPublishedName") also selects a published calculation by its exact name. Zero remains zero; optional missing cells display a dash. Text is displayed as text.
The latest observed snapshot is selected automatically. Use date: "2026-02-01" or periodIndex: 1 for an exact snapshot. An unavailable explicit date stays empty and fails validation when the widget is authored. scenario supports the ordinary active, named, indexed and all-scenario selections.
For a changing list, pass an array or keyed map of published calculation references, including a repeated output such as homes.outputs.breakdown. When explicit columns match scalar record fields, each source produces one row. Set rowLabelPath: "name" to use the current record's name. Comparable rows share one table; snapshots from different dates remain separate. Numeric maps can display a value column.
For a calculation with a declared owner, add sourceLabel: "owner" to display the owner's current name. A single-record source uses that name; map rows combine it with their row label, for example “Alex · Holiday home”. The names come from each scenario's actual entities.
For map keys that identify entities, use rowLabels: {entities: people, entityPath: "person"} when people is a repeated component with a person output. A direct keyed map of entity references needs no entityPath. The keys must match the result row keys. rowLabelPath still takes priority when the record supplies its own name. Foreign entities and unsafe paths are rejected; labels display as text. Omitting these options preserves the ordinary labels.
Contributions and totals
costs: Breakdown({
items: [
{ label: "Operating costs", source: homes.outputs.breakdown, path: "operatingCost" },
{ label: "Interest", source: interestFlow, sign: -1 }
],
year: 2026,
aggregation: "monthlyAverage",
chart: "stackedBar"
})Each source is an actual flow reference, metric selector, or published numeric calculation/projection. A source array combines repeated declarations. Optional path selects the same field from each published record. Define the sources in the calculation first; the widget does not calculate financial rules.
sum adds selected observations. last uses each source's last observed value in the selection. monthlyAverage divides by the calendar duration of the selected periods, including gaps. Monthly, quarterly and annual periods represent 1, 3 and 12 months. Daily and weekly periods use fractions of their calendar months. The displayed average is not an individual month's payment.
Use year, exact date or periodIndex to restrict the observations. Sources combined in a breakdown must share a declared currency or unit. The signed stacked bar supports income and expense contributions. Pie charts require non-negative contributions; choose signs explicitly. chart: "none" keeps the values and total without a chart. All-null and missing selections never become invented zeroes.
Ordinary source references read the published baseline even after Monte Carlo. To select sampled amounts consistently in cards, charts, tables and breakdowns, use source:{values:publishedCalculation,percentile:50,metrics:{"row.amount":results.metric("amountMetric")}}. The wrapper selects P50 by default and replaces only existing numeric or Money fields. Missing sampled percentiles remain unavailable. In a Breakdown item, path selects from the record after these mappings.
The sampled calculation source reference includes complete arguments, units, validation and callable examples. It also shows how to derive a positive gap as P50 expenses minus P50 income, clamped to zero, using the same medians in every display. These expressions do not estimate the percentile of a simulated difference. Ordinary references retain their existing behavior.