### Aggregation Type for Calculated Metrics in 2.14

When a metric or one of its thresholds is calculated, there is now a “Calculated Aggregation Type” choice for the metric.

You can choose either the same aggregation type as the non-calculated metric data, or you can choose “Use Equation”.

The reasoning behind this new enhancement is a little complicated, so it’s helpful to know its history.

A popular feature in the software is the ability to view a metric in a larger calendar view and automatically see the metric’s totals for that larger calendar. For example, if you view a monthly metric in yearly mode, the software will use that metric’s aggregation type to aggregate the 12 months into a yearly total. Metrics can have an aggregation type of sum, average, or already aggregated (uses the last value).

For calculated metrics, things are a little different. In the past, the software only used the “Use Equation” aggregation type for calculated metrics. This approach aggregates each of the metrics in the equation first, and then plugs the aggregated values into the equation. Here’s an example to help make things more clear.

Let's say you have a calculated metric for the percentage of airline flights that serve meals. It's an equation based on two monthly metrics: "number of flights with meals" divided by "total number of flights".

```
January: 2 flights with meals, 4 total flights = 50% with meals
February: 2 flights with meals, 100 total flights = 2% with meals
```

Now, what should the total percentage be for January and February? The correct way is to add up all of the "flights with meals" and divide that by the sum of the "total flights". We're aggregating each metric and then plugging the aggregated values into the equation.

```
Total: 4 flights with meals, 104 total flights = 3.8% with meals
```

In this situation it wouldn't make sense to first evaluate the entire equation for January and February and then aggregate those values. If we added the months it would be 52%. If we averaged the months it would be 26%.

Unfortunately, this approach doesn’t work for all calculated metrics. There are times, for example, when we want the yearly value for a calculated metric to just be the sum of that year’s months. In order to do this, we added the ability to choose how a calculated metric is aggregated. In the “Calculated Aggregation Type” dropdown, users can either choose the traditional “Use Equation” approach, or they can choose to aggregate the metric in the same ways as a non-calculated metric – sum, average, or already aggregated.