Skip to main content

Metric Formula How-To Guides

Write Your First Formula

Build Revenue = Volume × Unit Price, end to end. It needs no parameters, so you see the whole sequence without matching rules getting in the way.

What you need before you start

A sheet

With at least Time, Entity and Product dimensions

Two Input metrics

Volume (Number or Integer) and Unit Price (Currency), with some data

A third metric

Revenue, which becomes the Formula metric

The eleven steps

  1. Explore the Revenue metric. Open the Metric List and click Explore on the metric, or click a cell in the Revenue column and choose Explore Metric.
  2. Click Edit, then set the Data Type to Currency. Do this now: afterwards, Data Type can only be changed within its own group (The Five Metric Types).
  3. Set Metrics Type to Formula. Confirm “Are you sure you want to change Metric Type?”. New sections appear: Applies To, Layout (Rows and Input Metrics) and, because the sheet has Time, Set Opening Period, which you leave alone .
  4. Add the input metrics. Under Layout → Input Metrics, use (+) Add (tooltip Add Input Metric) and pick Volume, then Unit Price. The picker covers every sheet in the Space. The order you add them is their column order.
  5. Check the Function on each input. Both are numeric and carry all of the output's Row dimensions, so both default to Sum, which is correct (Formula Functions).
  6. Add no parameters. Both inputs have the same dimensions as the output, so the default matching rule maps each intersection to itself.
  7. Set the Summary Method to Sum. Revenue is an amount, so a parent-member total is meaningful.
  8. Save, then refresh the page. Volume and Unit Price appear as their own columns.
  9. Type the expression into the first data cell of the Revenue column. If Volume is in column D and Unit Price in column E, type =D2*E2. Data Details and Variance follow the Revenue column.
  10. Refresh again. The formula fills down. The Variance column reads Matched or Not Matched against the stored value, showing what a publish would change.
  11. Publish, choosing a recalculation scope (Publish Changes). For a new metric with no history, any option is fine.

Check it before you trust it

1. Arithmetic on one row

Multiply Volume by Unit Price for one row on a calculator and compare. This confirms the expression points at the right columns.

2. A second slice

Change the members in the Selection Bar — another entity, product or period — and check again. Matching errors do not show on a single row.

Things that go wrong on a first attempt

Symptom

Cause

“Formula is invalid! Data Details and Variance columns are not supported”

The formula refers to a reserved column. Point it at the input columns.

“Formula is invalid! Please check your syntax or list of supported functions.”

The formula was not saved; the previous one stays. Often a function the database does not have, a range, or a typo. See Expressions.

Every row is blank

Neither input has data there. If the input columns are blank too, the formula is fine.

Rows show zero

Only one input has data there. A missing input counts as zero.

The numbers are far too large

An input is at a finer grain than expected and is being totalled. Check each input's dimensions.

The formula referenced the wrong metric

Column letters are positional. If you changed the inputs after typing the expression, re-read it.

What to build second

Next, try a formula whose inputs are at different grains: rolling detail up (Scenario 3 on Scenario Guide).

Scenario Guide

Ten common situations, each with its configuration. Find the one that matches your problem. The tags also work backwards: on a formula you did not write, they show what it was for.

Which one do I need?

Arithmetic across metrics at the same grain ................. Scenario 1

Input is MORE detailed than my output (roll up) ............ Scenario 3

Input is LESS detailed than my output (broadcast down) ..... Scenario 4

The rate depends on a category, tier or band ............... Scenario 5

A percentage, ratio or variance ............................ Scenario 6

Inputs live on different sheets with different dimensions .. Scenario 7

The value is text, a status or a flag ...................... Scenario 9

A ranking or top-N within a group .......................... Scenario 10

The sheet must flag a tolerance breach ..................... Scenario 11

The result must be POSTED to a fixed member ................ Scenario 12

Not on either list? It may not be a formula — see What Metric Formula Is Not. For a slow formula, see Performance and Limits.

Scenario 1 · Straight arithmetic across metrics

Sum · + − × ÷

When: Revenue = Volume × Price; Gross Margin = Revenue − Cost of Sales. All inputs have the same dimensions as the output.

Inputs

Each onSum

Parameters

None — the default matching rule does this

Summary Method

Sum for an amount

=D2*E2

=D2-E2

=D2+E2+F2    -- individual cells; ranges are not supported

Step by step on Write Your First Formula.

Scenario 3 · Roll detail up to a coarser level (replaces SUMIF)

Sum · Set

When: cost captured by cost centre, reported by profit centre; revenue by SKU, analysed by brand. The mapping is held in master data.

Prerequisite

The input dimension carries a property pointing at the output dimension. A level group works the same way with no extra setup.

Input function

Sum — it does the rolling up

Parameter row

Set · output Profit Centre · As · input Cost Centre.Profit Centre

What happens: each cost centre's data is summed up to its profit centre. You never list members; a new cost centre is included as soon as master data gives it a profit centre.

Watch out: A member with a blank property contributes to nothing, with no error, so the total is short. Make sure the property is filled in for every member.

Scenario 4 · Push a parent rate down to all its children (replaces VLOOKUP)

Sum · Set · Preferences

When: one target per division for every team in it; one FX rate per country for every entity there; one allocation percentage per profit centre for every cost centre beneath.

Prerequisite 1

Add the output dimension's property to Rows via the Preferences link. Until you do, it is not in the list.

Prerequisite 2

The property is of type Link to another record and links to the input's dimension

Parameter row

Set · output Cost Centre.Profit Centre · As · input Profit Centre

What happens: the profit-centre value is copied to every cost centre with that property.

Scenarios 3 and 4 look the same — they are not: Property on the input aggregates up; property on the output broadcasts down. See Parameters and Matching.

Across Time: To hold one value across periods, pin Time with Filter on a Lookup input .

Scenario 5 · Rates that change by category, tier or band

IF · AND / OR · Preferences

When: utility costs that differ by site type, with peak, mid and off-peak rates; tiered commission; banded tax; step-rate depreciation by asset class.

Inputs

Every rate and driver metric you need, eachSum

Parameters

Usually none — the branching is in the expression

Layout

To branch on a dimension property, add it toRows via Preferences

=IF(C2="MFG",                     -- C is the SITE.TYPE property column

      D2*H2 + E2*I2 + F2*J2,

   IF(C2="ADMIN",

      K2*L2,

      M2*H2 + N2*I2 + O2*J2))

Watch out: Deeply nested IFs are hard to maintain. For a large rate card, hold the rates in a dimension property or a rate sheet and use Scenario 4.

Scenario 6 · Variance, ratios and percentages

Sum · Summary = None

When: Actual minus Budget as an amount and as a percentage of Budget; margin %, growth rate, utilisation. Some rows have a zero or blank denominator.

Variance Amount

Currency · Formula · Summary MethodSum

Variance %

Percentage · Formula · Summary MethodNone

Inputs

Actual (Sum), Budget (Sum), no parameters

=D2-E2          -- Variance Amount

=(D2-E2)/E2     -- Variance %, as a decimal

=(D2-E2)/E2*100 -- Variance %, out of 100

No guard needed: The denominator is a single input, so a zero or blank denominator returns blank. Use an IF only when you want a zero, or when the denominator contains a function.

Summary Method None, not Ratio: With the default of Sum, a quarter adds the monthly percentages — three months of 4% show as 12%. Ratio is not offered. None leaves the parent-member cell blank. To show a rolled-up percentage, build it as its own Formula metric that divides two amount metrics. See Limitations and Common Pitfalls.

Scenario 7 · Combine metrics from different sheets

Sum · Lookup · Add · Where

When: volume on an operational sheet, price on a commercial sheet, a conversion factor on a small rate table with no Time dimension. The sheets have different dimensions.

Inputs

Pick from any sheet in the Space

Different dimensions

Handled by the default matching rule — see Parameters and Matching

Reference inputs

Set the conversion factor toLookup

An output dimension no input has

Add · that dimension · From · a metric that carries it (filter icon)

=D2*E2*F2

Add example: Cost by Entity, Account and Time, spread by an Allocation % held by Cost Centre: on Cost, add Add · Cost Centre · From · Allocation %. Allocation % appears as its own column after Cost, and =D2*E2 gives cost × allocation % per cost centre. Full walk-through, including Where and Alias, in the Add section of Parameters and Matching.

Scenario 9 · Derive text, a status or a flag

Get · IF · &

When: carry an approval status from another sheet, derive a category label from a threshold, produce a Y/N flag, or join two fields into a description.

Output

Data Type Text, Boolean or List · Formula

Input function

Get — the exact value, no totalling

If Data Type is List

Fill in Allowed Values, or the save is rejected

Summary Method

None

=IF(D2>E2, "OVER", "WITHIN")

=IF(D2>0, "Y", "N")

=D2&" - "&E2

=MID(D2,1,3)

Watch out: Only CONCATENATE, &, MID and VALUE are converted for text. See Expressions.

Scenario 10 · Rank within a group

Group Output Data · Group Function · Group By

When: rank products by revenue within each market, or cost centres by overspend within each region.

Output

A numeric Data Type · Formula. The checkbox does not appear for text, date or control metrics. Integer suits a rank.

Enable

TickGroup Output Data

Group Function

Rank ASC, Rank DESC, Rank AVG ASC or Rank AVG DESC — required

Group By

The dimensions defining the group — Market, or Region + Period. Required.

Inputs

Exactly one metric

Direction: DESC ranks the highest value 1; ASC ranks the lowest 1. The AVG variants give tied rows the average rank.

Watch out: More than one input is rejected with “Only single metric selection is allowed when using Group Output Data functions.” To rank a calculated figure, build it as its own Formula metric first.

Match Group By to how the sheet is viewed. Grouped by Market alone and read across a year, it ranks the full-year total, not the month on screen.

Scenario 11 · Flag a tolerance breach

Data Type = Control · Control Type · Control Conditions

When: the sheet must show whether a derived figure is inside an agreed range — a balance that must reconcile to zero, a variance within ±5%. Some checks block a submission; others only warn.

Needs two settings together: Data Type must be Controland Metrics Type must be Formula. The control settings appear only when both are set. A Control metric can never be changed to another Data Type.

Control Type

Blocking reports Error on a breach; Warning reports Warning. A passing check reports Valid.

Inputs + formula

The figure being checked, built like any Formula metric

Control Conditions

Comparer Type, then the bound(s). The box is labelled Min, Max or Value; Between and Not between take a second bound.

Message

Shown on a breach. Name the figure and the tolerance.

Control Set

Optional — groups related control metrics

Comparer Types: Greater than · Less than · Between · Not between · Equal to · Not equal to · Greater than or equal to · Less than or equal to.

What you get: the checked figure, a Status column (green Valid, red Error, amber Warning), and a Message column that is blank while the check passes.

Watch out:The Comparer Type states the condition that must HOLD, not the breach. “Greater than 0” means valid when the figure is above zero. Set it the other way and every status is inverted.

You cannot add a control to an existing Number metric. Build the figure as its own Formula metric and add a separate Control metric that checks it.

To check what people type, or to send an alert, see the related tools on What Metric Formula Is Not.

Scenario 12 · Post the result to a fixed member

Sum · Assign

When: a derived figure must land on a specific member, not the one the source data sat on — a recharge written to an Adjustment audit member so the original stays visible, or a reclass posted to its own flow member.

Prerequisite

The dimension you post to is on the output metric

Input function

Sum — Assign is not offered on Lookup

Parameter row

Assign · output AUDIT · Eq · ADJUSTMENT

Read side

Add a Filter row naming only the source members

What happens: the named dimension is dropped from the read grain and the result is posted to the members you name.

Watch out: Without a Filter, the formula reads all members of that dimension and posts the total to one — including what it wrote on the previous run. Always pair Assign with a Filter. Test in a non-production version and confirm the target member with whoever owns the audit trail.

Was this article helpful?

We're sorry to hear that.