> ## Documentation Index
> Fetch the complete documentation index at: https://docs.explo.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Aggregations

Custom aggregations allow you to define aggregated metrics for a dataset that end users can use in the Report Builder when the standard aggregation set does not cover all use cases.

## Using a Custom Aggregation

Custom aggregations will appear when end users click on the `+` sign in the `Values` section of a report. End users can use the custom aggregation on its own or when data is grouped. They can also be used as the aggregation in visualizations.

<img src="https://mintcdn.com/explo/PKkXxOQ4Cq1reQN8/images/report-builder-features/custom-aggregation-example.png?fit=max&auto=format&n=PKkXxOQ4Cq1reQN8&q=85&s=0422585811911bb90c7d130a64624d35" alt="Configurations" width="753" height="464" data-path="images/report-builder-features/custom-aggregation-example.png" />

## Configuration

In the dataset configuration panel, open the tab called `Custom Aggregations` and click `New Custom Aggregation`.

<img src="https://mintcdn.com/explo/PKkXxOQ4Cq1reQN8/images/report-builder-features/custom-aggregations-configuration.png?fit=max&auto=format&n=PKkXxOQ4Cq1reQN8&q=85&s=7812c2fd8c9956be53d53d78c0ecc206" alt="Configurations" width="753" height="322" data-path="images/report-builder-features/custom-aggregations-configuration.png" />

First, name the aggregation. This is how the custom aggregation will be identified in the final Report Builder.

Then, define the aggregation using raw `SQL`. These are some examples of formulas you can write:

`SUM(tip_amount) / SUM(amount)`

`SUM(revenue) - SUM(cost)`

You can add a description for the aggregation that will appear to the right of the aggregation name in the reports.

<img src="https://mintcdn.com/explo/PKkXxOQ4Cq1reQN8/images/report-builder-features/custom-aggregation-description.png?fit=max&auto=format&n=PKkXxOQ4Cq1reQN8&q=85&s=e5e14d698b69467eeb936b39a3dc3a16" alt="Configurations" width="753" height="322" data-path="images/report-builder-features/custom-aggregation-description.png" />

Lastly, you can format the value of the custom aggregation. All standard value formatting options are available here.

<img src="https://mintcdn.com/explo/PKkXxOQ4Cq1reQN8/images/report-builder-features/custom-aggregation-formatting.png?fit=max&auto=format&n=PKkXxOQ4Cq1reQN8&q=85&s=cf15523c00b13e4992509452d18f3b46" alt="Configurations" width="753" height="464" data-path="images/report-builder-features/custom-aggregation-formatting.png" />
