Switchboard Docs
Analysis

Add a calculation

Compare and summarize the results of an explore

A calculation adds a measure to one explore. Use it for percentages, running totals, or comparisons between results. Use a model aggregation for a definition that other explores should reuse.

Before you start

You need permission to edit the document and query its models. Open an explore with the input fields selected. Check its filters and sort order first.

Add a built-in calculation

  1. Select Edit on the document, then Edit tile on the explore.
  2. In the field list, select Add calculation.
  3. Choose Calculation, then the operation you need.
  4. Set Calculation name and select the input Column.
  5. Select the calculation in the field list to include it in the result.
  6. Check a few values against a manual calculation.
  7. Close the editor. In Manual save, select Save changes on the document.

The menu groups operations by purpose:

GroupExamples
Row comparisonsPercent change from the previous row
PercentagesPercent of column total or maximum
Column summariesColumn total, running total, maximum, or rank
Row summariesRow total, running total, or maximum

For example, sort monthly revenue from oldest to newest before comparing each month with the previous row. Check that filters include the periods you want to compare.

Use a custom expression

Choose Add calculation → Calculation → Custom. Give it a name and enter its Expression. Use the editor's field suggestions to reference selected results. Check the SQL reference for expression syntax.

For a one-off summary of source rows, choose Aggregation from Add calculation instead. That summary belongs to the explore. It does not create a reusable metric in the model.

Resolve a missing input

Column missing means the calculation references a field that is no longer selected. Select that field again, or choose another input column. When a calculation changes unexpectedly, inspect its inputs, filters, and ordering before editing its formula.

Next step

Format the result or define a reusable aggregation.

On this page