Skip to main content

Metric Formula Key Concepts

Formula Functions

Every input metric in a formula has one function. It decides how the input's values are treated when more than one of them matches. There are six, and you never see all six at once.

Sum · Lookup · Get · Max · Min · Link

The six functions

Function

Use it when

What it does

Sum

The input is a numeric driver — a volume, a cost, an amount

Totals every matching source value. The usual default for numeric inputs.

Lookup

The input is reference data — a rate, a factor, a standard cost

Totals like Sum for numbers, but is secondary: it produces a value only where a non-Lookup input has data. Matched only on shared dimensions and repeated across the rest.

Get

The input holds text, a status, a flag or a date

Returns the exact value at the matching intersection, with no totalling. The usual default for non-numeric inputs; not offered for numeric ones.

Max

You want the highest of several matching values

Takes the largest, ignoring blank and zero rows. Numeric and Date only.

Min

You want the lowest of several matching values

Takes the smallest, ignoring blank and zero rows. Numeric and Date only.

Link

You are configuring a Linked metric

Mirrors one source metric. Offered only when Metrics Type is Linked.

Which ones you will be offered

The function list depends on the input metric's Data Type. A missing function is explained here, not by a bug or a permission.

Input metric's Data Type

Functions offered

Default

Number · Integer · Currency · Percentage

Sum · Lookup · Max · Min

Sum

Date

Lookup · Get · Max · Min

Get

Text · Boolean · List · Data Status · Document · Control

Lookup · Get

Get

Any, when the output metric's Metrics Type is Linked

Link only

Link

When the default is Lookup: When you add an input to a formula that already has inputs, and the new input lacks one of the output's Row dimensions, its function defaults to Lookup. The first input never does. Check the function on each input after adding it.

Get is not offered for numbers: To use one specific number rather than a total, narrow the input with a Filter until one value matches, and let Sum total that single row. If the filtered dimension is also on the output, a Sum input's result stays on the members you named; to apply the value to every member, make the input Lookup.

Sum, when there is only one matching value

In Volume × Price there is one volume and one price per intersection. The total of a single value is itself, so Sum is correct. It only adds when the input is at a finer grain than the output.

Lookup in detail

  1. It is secondary. It produces a value only where a non-Lookup input has data at that intersection. It cannot create rows on its own.
  2. It matches on shared dimensions only. Its value is repeated across the members of the output's other dimensions.
  3. It attaches optionally. Where there is no match, the driver's row still exists and the Lookup input counts as zero (or empty text).

That makes it the natural choice for a rate rather than a quantity.

At least one input must not be a Lookup: A formula made only of Lookups is rejected with “There has to be at least one non-Lookup input metric in your formula”. Keep the main driver on Sum.

Max and Min: function or expression

The function

Set on the input. Compares many source rows of one input — for example the highest monthly volume in the year. Excludes blank and zero rows, so a genuine zero cannot win a Min.

The expression form

Written in the expression. Compares values in the same row — =MAX(D2,E2) gives the larger of two metrics at that intersection.

Putting it together

Sales Price  =  Net Price  *  (1 + Markup %)

  Net Price   [ Sum ]      <- a driver, matched month to month

  Markup %    [ Lookup ]   <- pinned to one period by a Filter parameter, applied to every period

  FX Rate     [ Lookup ]   <- reference data: shared dimensions only, repeated, attaches optionally

Which source values match in the first place is decided by the matching rule and the parameters.

Parameters and Matching

Learn the rule that applies when there are no parameters. Most formulas need nothing more, and the ones that do become clear.

Set · Filter · Add · Where · Assign · Alias

Default matching rule: With no parameters, each input is matched to the output dimension by dimension:

  • Same dimension on both sides → matched to the same member.
  • Only on the input → totalled away by the input's function. For a non-numeric Lookup or Get input, the screen adds a mandatory Filter row for that dimension, which you set to one member.
  • Only on the output → a Lookup input's value is repeated across every member. Any other input goes to that dimension's default member; the screen adds an Assign row set to that member, which you can change.
  • Add parameters only for exceptions to this rule.

The default rule in practice

Dimension on both sides

March / entity 100 / product A on the input maps to the same intersection on the output.

On the input only

Costs by cost centre feeding a metric with no Cost Centre are added up by Sum or Lookup. Max and Min take the largest or smallest. Get does not total.

On the output only

A company-level rate on a Lookup input reaches every product. Make coarser reference data Lookup.

The default cannot connect two different dimensions — Cost Centre on one side, Profit Centre on the other — because that link is held in master data. That is what Set is for. For grain, see How Sheets, Metrics and Dimensions Relate.

How a parameter row reads

Each row reads as a sentence. The relation word is fixed by the parameter, so you choose three things:

  Set     ·   Profit Centre   ·   As   ·   Cost Centre.Profit Centre

  ^           ^                 ^             ^

  parameter   output field      relation      input field

              (my side)         (fixed)      (the source's side)

Parameter

Relation word

Reads as

Set

As

“treat my X as the source's Y”

Filter

Eq

“on the source, pin X to these members”

Add

Add … From

“bring these output dimensions in from that other metric”

Where

As

“join on this stated relation”

Assign

Eq

“post my result to these members of X”

Alias

As

“treat this dimension as a value-carrying alias”

Rows can be dragged to reorder them.

Set: connect two different dimensions

Set connects two dimensions through a property. It has two directions that look almost the same on screen and do opposite things.

Direction A — rolling detail up

The property is on the input side.

Situation

Cost is captured by Cost Centre; the pack reports by Profit Centre

Prerequisite

Cost Centre carries a property that links to Profit Centre

The row

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

Result

Each cost centre's data is summed up to its profit centre

Excel equivalent

SUMIF

Direction B — broadcasting a rate down

The property is on the output side.

Situation

One allocation percentage per Profit Centre must apply to every Cost Centre beneath it

Prerequisites

The output property is added to Rows via Preferences, and is of type Link to another record linking to the input's dimension

The row

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

Result

The profit-centre value is copied down to every cost centre with that property

Excel equivalent

VLOOKUP

Choose the direction deliberately: Property on the input: input values are summed into the output member the property names. Property on the output: the input value is copied to every output member whose property names it. Reverse them and you double-count or get blanks, with no error.

If the property is not in the list: For Direction B, add the output-side property to the metric's Rows with the Preferences link first. Until then it is not listed, and nothing says why.

Set and Time: A Set row with output Time and input Previous reads the prior period and shows an Offset box — that is how a rollforward is built. A Set row can also map Time to a Time property of type Link to another record (on the output side, added to Rows via Preferences) so each period reads its linked period.

Filter: pin a dimension to fixed members

Filter pins one dimension of one input to the members you name — one currency, one version, one account. The effect depends on the input's function:

On a Lookup input

The dimension is taken out of matching. The value from the named members applies to every member of that dimension on the output.

On a Sum, Get, Max or Min input

Only limits which source rows are read. The dimension still matches, so the result stays on the members you named.

Cost per Unit   [Sum]                                      <- still matches entity to entity

Std Rate        [Lookup;  FILTER: VERSION  Eq  "BUDGET"]   <- Version no longer matches;

                                                             the Budget rate is used in every scenario

Watch out: The pinned member is stored in the row. If the business moves to a different member, edit the row. Where the value could be held as a property of a dimension member, Direction B of Set needs no such edit.

Filtering Time: Pinning Time so one rate applies to every period, including the year-rollover trap,

Add: join another metric

Use Add when an input lacks an output dimension and another metric can supply it.

  1. On the input, add an Add row and choose one or more output dimensions the input does not have.
  2. After the label From, click the filter icon and pick the metric to join. The picker lists only metrics whose sheet section carries every dimension you chose.

The joined metric is matched to the input on the dimensions they share and supplies the members for the dimensions you chose. Its value appears as its own column in the formula grid, right after the input it is joined to. Reference it by column letter like any other input. Input rows with no matching row in the joined metric produce no result.

Example. Output Allocated Cost is by Entity, Account, Cost Centre and Time. Input Cost (Sum) is by Entity, Account and Time — no Cost Centre. Allocation % is by Entity, Cost Centre and Time. On Cost, add the row Add · Cost Centre · From · Allocation %:

Add  ·  [ Cost Centre ]  ·  From  ·  [ filter icon → Allocation % ]

Entity | Account | Cost Centre | Time | Cost (D) | Allocation % (E) | Allocated Cost

The expression =D2*E2 gives cost × allocation % for each cost centre. Add is a join, not arithmetic — to add numbers, use +.

On the joined metric

It has no function. You can add Where and Filter rows, and Alias for a List metric whose linked dimension is among the chosen dimensions.

On a Get input

If a chosen dimension is on both the input and the joined metric, you see A Filter or Where condition is required for dimensions that appear in both the Input metrics and the Add metrics. Add a Filter or Where row.

Where, Assign and Alias

Parameter

What it does

Where

Like Set, but states the join as a relation; used to join on a metric's own value. Only on a joined metric.

Assign

The only write-side parameter. It changes where the result lands: the named dimension is dropped from the read grain and the result is posted to the members you name — for example a derived movement on its own audit or flow member. Not offered on a Lookup input.

Alias

Marks a dimension as a value-carrying alias, so the same metric can appear more than once with different treatment. Its input side is always Measure. Only on a joined metric.

Why a parameter you expected is missing

The parameters offered depend on where you are:

Situation

What is offered

A top-level input withSum, Get, Max or Min

Set, Filter, Add, Assign

A top-level input withLookup

Set, Filter

A joined metric, under an Add row

Where, Filter, and sometimes Alias. The only place Where and Alias appear.

The output metric's Metrics Type is Linked or Summary

Assign and Filter only

A seventh parameter, Remove, is never offered.

Expressions

The expression is the part that looks like a spreadsheet formula. You type it into one cell, refer to the inputs by column letter, and it fills down. JustPerform converts a small set of spreadsheet functions.

IF · AND / OR · & · ROUNDUP · MID

How you enter it

After you add the inputs and refresh the page, each input appears as its own column, in the order you added them. Click the first data cell of the output metric's column and type a formula that refers to those columns:

=D2*E2

On refresh it fills down the column. The formula bar shows a readable version with sheet and metric names.

Finding the right cell: A Formula metric's column is followed by two reserved columns, Data Details and Variance, so the cell you want is not the last one. A formula that refers to either column gives “Formula is invalid! Data Details and Variance columns are not supported” and the cell goes back to its previous formula. A Control metric has two more columns before those, Status and Message.

Variance reads Matched or Not Matched, comparing what your formula now produces with what is stored. Before publishing, it shows which rows will change.

Column letters are positional:D2 means “the fourth column”. If you reorder or remove an input, re-read the expression — it still saves, but may now point at a different metric.

What JustPerform converts

These functions and operators are converted for your analytics database.

Category

Converted

Operators

+-*/& and parentheses · comparisons =<><><=>= · percentage literals such as 20%

Logical

IF · AND · OR — function form only

Rounding

ROUNDUP(number, digits) · ROUNDDOWN(number, digits) — both need the number of digits

Comparison of values

MIN · MAX — the smallest or largest of the values you list

Text

CONCATENATE · MID · VALUE (text to number)

Formatting

FIXED(number, decimals, [no_commas]) — shows a number to the given decimal places; the exact output depends on the analytics database

Date

NOW() · DATE(year, month, day) with the numbers typed in

ROUNDUP and ROUNDDOWN on negative numbers:ROUNDUP rounds towards the higher number and ROUNDDOWN towards the lower. For negative numbers that is the opposite of Excel: ROUNDUP(-2.345, 2) gives -2.34 and ROUNDDOWN(-2.345, 2) gives -2.35.

Conditions

IF is the only conditional. Nest it for more than two branches. The else argument is optional; without it, non-matching rows are blank.

=IF(D2=1, E2*G2, F2*G2)                 -- simple branch

=IF(AND(D2>0, E2>0), D2/E2, 0)          -- AND in function form, never infix

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

      D2*H2 + E2*I2,                       conditions can test a dimension property,

   IF(C2="ADMIN",                          not only a metric value

      K2*L2,

      M2*H2 + N2*I2))

To branch on a property, add it to the metric's Rows via Preferences so it appears as a column, then refer to that column's cell. The formula bar shows it as 'SITE.TYPE' in single quotes; the text you compare it with goes in double quotes. A dimension column can be referenced the same way to compare the member.

Watch out: Write AND and OR as functions — IF(AND(D2>0, E2>0), …), not IF(D2>0 AND E2>0, …). NOT is not converted: swap the then and else branches instead.

Division by zero

Simple denominators are protected: When the denominator is a single input, a number, or a simple bracketed expression such as (E2+F2), a zero or blank denominator returns blank — not an error and not zero. So =(D2-E2)/E2 is safe on a zero budget. Use =IF(E2<>0, (D2-E2)/E2, 0) when you want a zero instead of a blank.

Not protected: A denominator with a function or nested brackets — /MAX(E2,F2) or /((E2+F2)*G2) — is not protected, and /MAX(E2,F2) without outer brackets cannot be published. Guard it with IF: =IF(MAX(E2,F2)<>0, D2/(MAX(E2,F2)), 0).

What is not supported, and what to use instead

You reach for

Status

Do this instead

SUMIF / SUMIFS

X

The Set parameter, Direction A — Parameters and Matching.

VLOOKUP / HLOOKUP

X

The Set parameter, Direction B.

INDEX / MATCH

X

Dimension matching replaces positional lookup.

ROUND

X

ROUNDUP or ROUNDDOWN — choose a direction, and note their behaviour on negative numbers.

AVERAGE

X

Divide explicitly, or set Summary Method to Average for parent-member cells.

COUNTIF

X

Build a 1/0 flag metric with IF, then sum that metric.

IFERROR

X

Simple divisions are already guarded. Otherwise test the condition with IF.

ISBLANK

X

Compare with zero or empty text, depending on the Data Type — a missing input counts as zero, or empty text for a text input.

TEXT / SUBSTITUTE / FIND / SEARCH

X

No substitute.

SWITCH

X

Nested IF.

RangesD2:D10

X

List cells individually: =D2+E2+F2.

Financial

X

No NPV, IRR or PMT.

Other function names

Do not rely on a function that is not converted, even if it works: Function names are not checked against a list. Any other name — for example ABS, SQRT, LEFT or TRIM — is passed to the analytics database unchanged. If the database has no such function, publishing fails with “Formula is invalid! Please check your syntax or list of supported functions.” If it has one, the database's version runs, and it may differ from Excel.

Check the result against a few rows worked out by hand before you rely on it. Do not use SUM inside an expression; add values with +.

Why results can differ slightly from Excel

The arithmetic runs in the analytics database, and JustPerform supports several database families.

  • Use parentheses for precedence. Operator precedence and type coercion come from the database.
  • A missing input counts as zero (empty text for a text input), not blank. So =D2*E2 with both inputs on Sum returns zero where only one has data.
  • Rounding and edge cases can differ. For a parallel-run sign-off, agree a tolerance up front.

Was this article helpful?

We're sorry to hear that.