Create a calculated metric (ratio, specific value, formula)
On the Calculated metrics page you build a new metric from the existing ones: a ratio (specific value), a difference, or any formula — say, specific energy use = energy / production. As the page puts it: “It is computed from data you already have, so it appears for EARLIER periods immediately — no recomputation to wait for.”
Before you start
Section titled “Before you start”- Permission: analytics:manage — without it, saving says: “This needs
the “Analytics – manage” permission.” Anyone with
analytics:viewcan see the finished metric. - Site: a calculated metric belongs to a site — the page works on the site selected in the header (“No site is selected. Switch site in the header.”).
- Inputs: the formula references metrics, not raw diary fields — anything without a configured meaning is not selectable.
- Open the “Calculated metrics” page from the analytics tab bar and click “New calculated metric”. (The list also shows the site’s existing calculated metrics with today’s values.)
- Name it (“Metric name”, e.g. “Specific energy use”). The “Identifier” derives from it — “This is the technical key on tiles and in exports” — lower-case letters, digits and underscores only.
- Write the formula. “Insert a metric from the list” inserts a reference; the
+ - * / %operators with parentheses and themin,max,abs,round,floor,ceilfunctions are available. Two special prefixes exist:prev.gives the previous period’s value (e.g.prev.dp.energy.kwh), andn.gives a count — in the help text’s own example: “n.ops.state.maintenance is the number of maintenance segments, so mean time to repair = ops.state.maintenance / n.ops.state.maintenance.” - Set the unit (“Unit”, e.g. kWh/t) — “We cannot infer it from mixed sources, so you set it — or leave it empty.”
- Check the “Preview” box — the metric evaluates immediately for the selected period, and the “Amount of data” row tells you how many measurements it came from (by the input with the least data).
- Save. The confirmation: “Calculated metric saved. It can now be selected on tiles.”
If it worked
Section titled “If it worked”The new metric appears in the tiles’ metric picker and among the export’s metric columns, and it has values for earlier periods too — provided its inputs were recorded.
Common problems
Section titled “Common problems”| What you see | Why | What to do |
|---|---|---|
| “You cannot reference a calculated metric — this rules out circular formulas.” | The formula contains another calculated metric. | Reference the source metrics directly — write the formula “flat”. |
| “The formula must contain at least one metric (a bare number is not a metric).” | Only a constant stands in the formula. | Insert at least one metric reference from the list. |
| “No value: this data is missing for the period: {refs}. This is NOT zero — the missing data has to be recorded.” | One of the inputs is empty for that period. | Not the formula’s fault: record the missing data in the diary. |
| “No value: the denominator is zero in this period (e.g. there was no production).” | The ratio’s denominator is 0. | Nothing — “That is data, not an error — the ratio simply has no meaning here.” |
| “Someone else changed this metric in the meantime.” | Two editors worked on the same metric. | Reload the page, check its current state, then save again. |
Worth knowing
Section titled “Worth knowing”- Missing data is never zero. When an input is missing, the metric has no value for that period — the system never silently writes 0, and always says which data is missing.
- Deleting: “Calculated metric deleted. Tiles pointing at it will say so.” — tiles do not vanish silently; they state that the reference went stale.
- Limits: a formula holds a finite number of references, and each site has a metric cap — when you hit it, the UI says so (“Delete an old one, or contact us.”).
Related
Section titled “Related”Build a dashboard viewPutting the new metric on a tile, attaching a target/threshold.
Compose and save an exportThe calculated metric as a column in the CSV/Excel report.