Formulas
Combine metrics with arithmetic to chart ratios, rates and per-player values: conversion rates, revenue per user, stickiness. Give a formula its own metrics to make it portable, then save it and reuse it in any query.
A formula is a metric you calculate from other metrics. Instead of charting purchases and players separately, chart B / A * 100 and see your conversion rate directly. Formulas work in insight queries, on any visualization, with filters and breakdowns.
Uses A, B.
| Metric | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|---|
| Asession_start · Unique users | 1,200 | 1,350 | — | 0 | 1,500 | 2,100 | 1,900 |
| Bpurchase · Unique users | 60 | 81 | — | 12 | 96 | 147 | 114 |
| Cpurchase · Sum of price | 540 | 790 | — | 95 | 1,010 | 1,680 | 1,240 |
| B / A * 100 | 5 | 6 | 0 | 0 | 6.4 | 7 | 6 |
Over the week, from the formula's own daily values: average 5.07, min 0, max 7. Wednesday has no data, so it shows 0 and isn't counted. Dividing by zero shows 0 too: Thursday has no sessions.
Adding a formula
- Add the metrics you want to combine. In the query builder, add the metrics the formula needs, for example Unique users of
session_startand Unique users ofpurchase. Each metric gets a letter: the first is A, the second B, and so on. - Add a formula. Click the + beside Metrics, open the Formula tab, and choose New formula. The formula appears below your metrics, labelled ƒ1 (the next one is ƒ2).
- Write the expression after the
=, for exampleB / A * 100. Type@(or click the @ button) to pick a metric from a list instead of remembering its letter. The chart updates as you type. - Hide the inputs (optional). To chart only the result, choose Hide metric from each input's ⋯ menu. Hidden metrics are still calculated for the formula; they just aren't drawn.
Changing a formula doesn't re-run the query. Gamebeast calculates formulas from metric results it already has, so editing an expression, renaming it or changing its unit shows up immediately, even on queries that take a while to run.
Writing expressions
An expression combines metric letters and numbers with arithmetic:
| Operator | Meaning | Example |
|---|---|---|
+ | Add | A + B |
- | Subtract, or negate | A - B, -A |
* | Multiply | A * 100 |
/ | Divide | B / A |
^ | Raise to a power | A ^ 2 |
( ) | Group | (A + B) / C |
The order of operations is the usual one: parentheses first, then ^, then * and /, then + and -. Operators of equal precedence run left to right, except ^, which runs right to left (2 ^ 3 ^ 2 is 2 ^ 9).
A few more rules:
- Letters are single uppercase letters,
AthroughZ. Lowercase letters are converted as you type in the builder. - Numbers can be whole or decimal:
100,0.5,.5. - Writing two things side by side multiplies them:
2Ais2 * A, andA(B + C)isA * (B + C). Spell out the*when it makes the formula easier to read. - Spaces don't matter:
B/A*100andB / A * 100are the same.
Division by zero
A result that can't be represented, such as dividing by zero, shows as 0 instead of breaking the chart. If A is 0 on a given day, B / A is 0 for that day.
Keep this in mind when reading ratios. A conversion rate of 0 can mean nobody converted, or that nobody was there to convert. To tell them apart, keep the denominator visible on the chart, or add it as a second formula.
How formulas are calculated
A formula is calculated separately for every point on the chart.
- Over time, each bucket (each day, hour or week) uses that bucket's metric values. On Tuesday,
B / Ais Tuesday'sBdivided by Tuesday'sA. - With a breakdown, each breakdown value is calculated on its own. Broken down by country,
B / Afor France uses France'sBand France'sA. - On a single number or bar chart that covers the whole range, the formula uses the metrics' totals for the range.
- A bucket with no data for any of the formula's metrics shows as 0 and is left out of the formula's summary values. If only some of the metrics have data, the missing ones count as 0.
Average of the ratio, or ratio of the totals?
The summary values for a formula over time (its average, minimum, maximum and total in the legend
and tooltips) are worked out from the formula's own values in each bucket. So the "average" of a
daily B / A is the average of the daily ratios, which isn't the same as total B divided by
total A for the period. For the ratio of the totals, chart the formula as a single number.
Display
Formulas are shown with two decimal places. To show a formula as a percentage, currency or duration, or to change the decimal places, click the icon at the left of the formula and choose a unit, the same as for any other metric. Units only change how values are shown: B / A with the % unit still shows 0.05 as 0.05%, so multiply by 100 in the expression when you want a percentage.
To rename a formula, choose Edit display name from its ⋯ menu. The name is used in the legend, tooltips and table.
Formulas that use the query's metrics
By default, a formula's letters refer to the query's metrics, in the order they're listed. Formulas don't take a letter, so they don't shift other metrics' letters: with metrics A and B and formula ƒ1 between them, the metric after ƒ1 is still B.
Letters follow the metric, not its position:
- Reordering metrics updates every formula that uses them. If you drag B above A, a formula
B / Ais rewritten toA / B, so it keeps calculating the same thing. - Removing a metric a formula uses marks the formula with A metric this formula used was removed. Point it at another metric, or remove it.
Formulas can't use other formulas. To build on a calculation, write it out in full: instead of ƒ1 * 2, use (B / A) * 2.
Giving a formula its own metrics
A formula can also carry its own metrics, listed inside it under the expression. Its letters then refer only to those metrics, not to the query's, so it calculates the same thing in any query you put it in. That's what makes a formula portable, and it's what lets you save it.
There are three ways to give a formula its own metrics:
- Drag a metric onto the formula. The metric moves inside the formula and takes the next letter there. Drag it back out to return it to the query.
- Click + Metric inside the formula to add a new one and pick its event.
- Choose Add referenced metrics from the formula's ⋯ menu. The query's metrics the formula uses are copied inside it, and its letters are rewritten to match. The query's metrics are left where they are. The option appears once the expression uses at least one of the query's metrics.
Metrics inside a formula work like any other metric: choose their event and measurement, add local filters, and reorder them. They aren't drawn on the chart. Only the formula's result is. A formula can have up to 10 metrics of its own.
Once a formula has metrics of its own, it no longer sees the query's metrics. If its expression uses a letter it doesn't have, it shows There's no metric C: use A–B. Add the metric inside the formula, or change the letter.
Saved formulas
A formula with its own metrics can be saved and reused across your project, so a metric like Revenue per paying user is defined once and calculated the same way on every chart.
Saving a formula
Click Save formula under a formula's metrics, give it a name (and optionally a description), and save. The Save formula button only appears once a formula has its own metrics. A formula that uses the query's metrics can't be saved, because those metrics might not exist in the next query.
The formula in your query is now linked to the saved formula. It's shown collapsed: its expression, and the event and measurement behind each letter.
Using a saved formula
Click the + beside Metrics and open the Formula tab. Saved formulas are listed under Saved formulas: hover one to preview its expression and metrics, then click it to add it. Search filters the list by name.
Global filters and breakdowns apply to saved formulas the same way they apply to every other metric in the query.
Editing a saved formula
Because queries stay linked to a saved formula, editing it changes every chart that uses it. Click Edit on a linked formula to open its editor. A banner says how many other saved queries use it. Click Update to save your changes to the saved formula, or Cancel to discard them.
Changing the display name or unit of a linked formula only changes it in this query.
Detaching
To change a formula for one query without touching the saved version, choose Detach from saved from its ⋯ menu. The query gets its own copy, with its own metrics, that you can edit freely. Nothing else changes.
Deleting a saved formula
Hover a saved formula in the Formula tab and click the delete icon. The confirmation says how many saved queries use it. Those queries keep working: they show the formula's last version, with a note that the saved formula was deleted, and you can Detach it to edit it again. Deleting can't be undone.
When a formula has a problem
The builder checks formulas as you type. While an expression is unfinished, such as B / or (A + B, the formula is left off the chart and a hint says what's missing. A query can't be saved while one of its formulas has a problem. If every metric on the chart is an unfinished formula, the chart says so instead of showing an error.
| Message | What to do |
|---|---|
| Enter an expression | The formula is empty. Type an expression after the =. |
| Add a metric or number after "/" | The expression ends with an operator. Finish it. |
| Close the parenthesis with ")" | A ( has no matching ). |
| This ")" has no matching "(" | Remove the extra ), or add the missing (. |
| "*" can't follow "/" | Two operators in a row. Remove one, or put a metric or number between them. |
| There's no metric C: use A–B | The letter doesn't match a metric. Add one, or use a letter that exists. |
| A metric this formula used was removed | Point the formula at another metric, or remove it. |
| Use uppercase letters | Metric letters are uppercase: A, not a. |
| Saved formula deleted | The chart uses the formula's last version. Detach it to edit it. |
Examples
| Formula | Metrics | Expression |
|---|---|---|
| Conversion rate (%) | A: Unique users of session_start, B: Unique users of purchase | B / A * 100 |
| Revenue per user (ARPU) | A: Unique users of session_start, B: Sum of price on purchase | B / A |
| Revenue per paying user | A: Unique users of purchase, B: Sum of price on purchase | B / A |
| Stickiness (DAU / MAU, %) | A: Daily active users, B: Monthly active users | A / B * 100 |
| Purchases per session | A: Total session_start, B: Total purchase | B / A |
| Tutorial drop-off | A: Unique users of tutorial_start, B: Unique users of tutorial_complete | (A - B) / A * 100 |
| Net currency flow | A: Sum of amount on coins_earned, B: Sum of amount on coins_spent | A - B |
| Robux to USD | A: Sum of price on purchase (in Robux) | A * 0.0035 |
The same event can appear more than once with different measurements or filters. For a conversion rate within one segment, add the same local filter to both metrics.
With the assistant and MCP
The assistant and agents connected over MCP build formulas the same way you do. Ask for "purchase conversion rate by country" and they'll add the metrics and the formula, and the result opens in the builder like any formula you wrote.
Agents can manage saved formulas too. list_saved_formulas lists a project's saved formulas. create_saved_formula, update_saved_formula and delete_saved_formula change them, and say how many saved queries an update or deletion affects. In the dashboard, the assistant asks for your approval before changing a saved formula, like any other change.
Limits
- Formulas are available on insight queries. Funnels, retention and heatmaps don't use them.
- A formula can use letters
AtoZ, and have up to 10 metrics of its own. - A query can calculate up to 25 metrics in total, counting the metrics inside formulas.
- Formulas can't use other formulas, and saved formulas can't be placed inside formulas.
- A breakdown's Rank by can't use a formula. Breakdown values are ranked by one of the query's event metrics.
Heatmaps
Heatmaps are a powerful way to visualize user interactions in your Roblox experience. They allow you to see where players are spending their time, which areas are most popular, and how players are moving through your game.
User Cohorts
Group players by what they did (events, spend, deeplinks, experiments, and funnels) and use the group to filter or break down any query.