Skip to content

Adding formulas

A formula defines how a metric is calculated from other metrics and numbers.

Formulas matter for three reasons:

  1. They produce the values of custom KPIs.
  2. They let FinSentry identify drivers. A metric with no formula cannot be broken down, so it gets no drivers.
  3. They let FinSentry check uploaded values. See Calculation mismatches.

Where to set them

  • During upload — the "Set formulas" step.
  • Later — the dataset page, under Manage formulas. Editing a formula there re-runs all checks for the dataset. The uploaded values stay unchanged.

The driver tree page shows how the current formulas connect.

Writing a formula

Piece Examples
Another metric [revenue], [Contribution Margin]
A number 12, 1.5, 0,25
Operators + - * /
Brackets ( )

Example:

( [revenue] - [material_cost] - [labor_cost] ) / [revenue] * 100

By default each metric just uses its own raw column. A metric left this way produces no drivers.

Checks while you type

  • Autocomplete suggests metric names as you type inside [ ].
  • Suggest formulas proposes formulas by looking at the uploaded data — for example, spotting that a margin column always equals revenue minus cost.
  • Formula check compares your formula against the uploaded rows and reports whether it matches: correct, close, or mismatch.

A formula is rejected if it is empty, has unbalanced brackets, starts or ends with an operator, divides by zero, or contains no metric at all.

Choosing metrics for anomaly detection

Each metric has a Run anomaly detection checkbox. Ticked metrics are the ones scanned by anomaly detection.

Calculation mismatches

When an uploaded metric has a formula, every check run recalculates the formula for each uploaded row and compares the result with the uploaded value. A row matches when the difference is at most 0.05 or 1 % of the uploaded value, whichever is larger. That allows for values rounded to cents.

Rows outside that tolerance are reported as calculation_mismatch anomalies, one per cost center and run of consecutive months. Severity depends on the largest relative error: below 2 % is low, below 10 % is medium, from 10 % up is high. Each metric is checked only against its direct inputs, so a mismatch points at the metric whose values are wrong.

Formulas that reference their own metric, and custom KPIs (which are calculated from their formula), are not checked.

Getting useful drivers

  1. Leave the basic metrics (revenue, costs, hours) as their raw columns.
  2. Build the metrics you actually manage against — margin, margin %, cost per hour — as formulas over those basics.
  3. Turn on anomaly detection for those calculated metrics.

When one of them goes anomalous, FinSentry can follow its formula down to the basic inputs and tell you which one moved.