Variants: a dimension, not a metric each
Some models keep a metric for each currency or sales channel, such as Revenue (EUR) web and Revenue (USD) app. Model them as one metric, Revenue, with currency and channel as dimensions. Agents then find what your team wrote about revenue, whatever the currency.
Why one metric works better
- Agents read a question by the names in it. “Revenue in EUR” and “Why did revenue drop last week?” both name Revenue. With a metric for each variant, no metric is called Revenue: the question names nothing, and the agent is asked to name one.
- A context item about revenue applies to one metric, not to hundreds.
- A change to how revenue is worked out changes one definition. The context about it is due for a check once, not once for each variant.
- Definitions stays a list people can read.
What Test connection says
When many of the metrics a read would hold look like variants of a few, Test connection in Integrations says so before anything is published. It says how many, how many metrics they look like, and the words they are split by, such as eur, usd and gbp.
It reads only the names, so now and then it is wrong. It only warns: you can still go on.
How to model them
Keep one metric for each amount, and make what varies a dimension:
- Currency: a dimension of the orders, such as their currency code. A question about one currency filters by it.
- A sales channel, a region or a market: a dimension in the same way.
- A tool that lets one metric follow a choice, such as which currency to show, keeps one metric for every currency too.
Totals across currencies
A sum over several currencies needs one reporting currency. Keep the amount in the reporting currency as a metric of its own, or let the choice of currency convert it.
If you keep a metric for each variant
A read groups near-identical metrics into a family, such as Revenue, with 250 variants by Currency and Channel. It finds a family in four ways, and trusts them in this order:
- Declared in your tool. A metric that names its family under
meta.footnoteis a variant of it, as written. Two metrics are enough. - Found from the calculation, with filters that differ only by the value they compare, such as EUR or web. Three metrics are enough.
- Found from a rate. A metric worked out from another with one more column, such as Accrued share (USD) from Accrued share (EUR) and the column
exchange_rate_usd. When that column does this for several pairs, each pair is a family by Currency. - Suggested by the names alone. Metrics whose names are one name in other currencies, such as Shipping fee (EUR) and Shipping fee (USD), wait under Look alike on the Names card. They are never a family until you say so.
- On the Names card a family is one name, marked declared in your tool or found from the calculation. Publish it, and its variants are published with it.
- Under Look alike, choose Publish as a family, or Publish apart to publish each metric by its own name.
- Definitions lists the family once, marked Family · 250 variants. A search for a variant, such as revenue eur web, finds its family. Only the family’s own page lists the variants, says how the family was found, and which variant is converted from which.
- A context item about the family applies to every variant, and agents get it for a question about revenue.
- When any variant changes, the item is due for a check once, not once for each variant.
A source that gives only the names of its metrics, not how they are worked out, makes families only from what it declares. The other metrics whose names look alike wait under Look alike.
Declare a family in your tool
You never have to. Declaring is the surest way, and the only way for variants that are columns of their own, such as a sales line. Under each variant’s meta, write the family’s name and the values that tell it apart:
metrics: - name: net_revenue_retail_eur config: meta: footnote: family: net_revenue by: sales_line: retail currency: EURIn a tool whose metrics are measures, the same footnote key goes under the measure’s meta. Every variant names the same family and the same keys under by, each with its own values. A name under by that is a dimension of the view is shown by that dimension’s name.
To say what the family means, add family_description beside family, with the same words on each variant that has it. Definitions and agents then read those words for the family, and nobody can replace them here. Variants that give different words are read without them, and Test connection says so.
A family that can’t be kept is read as separate metrics, and Test connection says why: only one metric names it, its metrics are in different views, one is a dimension, they name different keys under by, or two name the same values.