Formulas and Calculations

Create calculated metrics with formulas

Last updated: December 20, 2024

Formulas and Calculations

Create powerful calculated metrics using the formula builder.

Basic Syntax

Reference other metrics using curly braces:

{Metric Name}

Operators

  • Addition: +
  • Subtraction: -
  • Multiplication:
  • Division: /
  • Parentheses: ( )

Examples

Profit Margin

({Revenue} - {Cost of Goods Sold}) / {Revenue}  100

Average Deal Size

{Total Revenue} / {Number of Deals}

Conversion Rate

{Conversions} / {Visitors} * 100

Functions

  • SUM(metric1, metric2, ...) - Add multiple metrics
  • AVG(metric1, metric2, ...) - Average of metrics
  • MIN(metric1, metric2, ...) - Minimum value
  • MAX(metric1, metric2, ...) - Maximum value
  • ABS(metric) - Absolute value
  • ROUND(metric, decimals) - Round to decimals

Handling Missing Values

  • If any referenced metric has no value, the result is blank
  • Use defaults: {Metric Name} ?? 0 (default to 0 if blank)

Tips

  • Test formulas with known values
  • Keep formulas simple when possible
  • Document complex calculations
  • Consider performance with many dependencies

Was this article helpful?