---
title: Reusable metrics
slug: analytics/docs/reusable-metrics
docTags: 
createdAt: 2026-07-20T15:44:38.781Z
---

Reusable metrics in Optimizely Analytics are computed properties that you can define once and reference across any Optimizely Analytics exploration, dashboard, or experiment. Instead of rebuilding calculations from scratch every time, you can create a standardized metric that includes complex logic, such as:

- Joins with other datasets to enrich your analysis.
- Filters to home in on specific user segments or behaviors.
- Aggregations to sum, average, or count key values.

With [metric presets](docId:9zga6mORJKvRK6j3OqmXG), you can also pre-configure how a metric displays and behaves wherever it is used. This eliminates the need to reapply the same settings in multiple places, ensuring consistency.

Use [Blocks](docId\:bX_YvRDHmNihcjmYwv0RS) to customize metrics if the existing templates do not match your requirements. There is also a subset of five metric templates that you can use to get started, and they are as follows:

- [Simple aggregation](docId:9zga6mORJKvRK6j3OqmXG)
- [Filter](docId:9zga6mORJKvRK6j3OqmXG)
- [And/Or](docId:9zga6mORJKvRK6j3OqmXG)
- [Custom](docId:9zga6mORJKvRK6j3OqmXG)
- [Formula](docId:9zga6mORJKvRK6j3OqmXG)

You can use a metric anywhere in the app where the **Catalog** is accessible. The configuration for a metric is saved within Analytics and is accessible through the **Catalog**. You can use it like any other column in the catalog.

A metric has the following configuration:

- **Name** – Ensure the metric's name is unique across columns (including metrics and cohorts) within that dataset.
- **Default aggregation** – Choose an aggregation type, such as count or sum, that is used by default when the metric serves as a measure.

:::hint{type="info"}
**Note**

Metrics are not tied to a specific dataset. This is a key difference between metrics and derived columns.
:::

## Create reusable metric definitions

Within the **Definition** tab in **Metrics**, you can add the basic information and definition for your metric.

1. Click **Add (+)** **>** **Metric**.
2. Choose from templates like **Simple Aggregation**, **And/Or**, and **Filter**, or create **Custom** metrics using [blocks](docId\:bX_YvRDHmNihcjmYwv0RS). This choice helps you get started, but you can change it later if needed. Use blocks to define the computation for your metric in the block editor.
3. Enter a name and description.
4. Click **Run** to sample the computed values. The resulting table displays the metric values, along with any associated dimensions.
5. Click **Save**.

You can now use the metric as a catalog entity anywhere the catalog is accessible, like inside exploration templates or the block editor.

![met-def.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/Yy-T7ul3zmilgyf9AlKMd-20260720-144931.png)

## Types of reusable metric templates[​](https://app.netspring.io/documentation/docs/Model%20Behavioral%20Semantics/metrics#types-of-metrics)

### Simple aggregation[​](https://app.netspring.io/documentation/docs/Model%20Behavioral%20Semantics/metrics#simple-aggregation)

This template lets you calculate a simple aggregated metric. For example, to create a metric for total subscription revenue, which is the total revenue generated by Flix's monthly subscriptions,

1. Go to **+ > Metrics > Simple Aggregation**.
2. Click **Unnamed Metric**, and enter a name and description.
3. Choose **sum** as the aggregator and set **price** from the subscriptions dataset as the value in the **Aggregate** block.
4. Click **Run**. Use the drop-down list in the visualization window to select a different chart type.
5. Click **Save**.

![opti-metrics-1.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/Bfc4kFr9VQWZFoWrgyKWl-20260720-144931.png)

### Filter[​](https://app.netspring.io/documentation/docs/Model%20Behavioral%20Semantics/metrics#filter)

This metric template lets you apply a filter to any input. For example, to create a metric for users whose total time viewed on the platform exceeds 100,000 minutes,

1. Go to **+ > Metrics > Filter**.
2. Click **Unnamed Metric**, and enter a name and description.
3. Select **All Users** as the value in the filter block.
4. Choose **Total Time Viewed (TTV)**, and set the condition to "**> 100,000.**"
5. Click **Run**.
6. Click **Save**.

![opti-metrics-2.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/2N-suKaNai93m-pGb1GGt-20260720-144931.png)

### And/Or[​](https://app.netspring.io/documentation/docs/Model%20Behavioral%20Semantics/metrics#andor)

This metric template lets you use nested and/or statements to produce a true or false value. For example, to create a metric for purchases made and total time viewed in the last 30 days,

1. Go to **+ > Metrics > And/Or**.
2. Click **Unnamed Metric**, and enter a name and description.
3. Choose the **Purchased in Last 30 Days** cohort in the and/or block, and set the value to **True**.
4. Click **+** to add another condition. Choose the **TTV Last 30 Days** derived column and set the value to **500**.
5. Click **Run**.
6. Click **Save**.

![opti-metrics-3.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/JLz7fj83u1fBoaaPdTgxD-20260720-144931.png)

### Custom[​](https://app.netspring.io/documentation/docs/Model%20Behavioral%20Semantics/metrics#custom)

This template lets you calculate a cohort of values by composing multiple blocks. For example, you can create a metric to determine the average total time viewers spend viewing content on the platform:

1. Go to **+ > Metrics > Custom**.
2. Click **Unnamed Metric**, and enter a name and description.
3. Click **+ Add Block > Formula**.
4. Enter the following formula in the formula block to calculate the incremental duration:

```auto
Data.Content.duration * Data."Product Events"."Incremental Completion Fraction"
```

5. Add an **Aggregate** block and name it *Aggregate 1*. Set the aggregator to **sum**, and choose the **Incremental Duration** block as the value. Add a filter for the event type **Play Content** and group the results by **Users**.
6. Add another aggregate block, naming it *Aggregate 2*. Set the aggregator to **avg** and choose **Aggregate 1** as the value.
7. Click **Run**.
8. Click **Save**.

![opti-metrics-4.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/jC6LW_XOiz2TeCDVpdaZZ-20260720-144931.png)

### Formula[​](https://app.netspring.io/documentation/docs/Model%20Behavioral%20Semantics/metrics#formula)

This template lets you write a custom formula using algebraic operations and functions like round, substring, and so on. For example, you can create a metric for total revenue, which includes revenue from pay-per-view (PPV) purchases, advertisements, and monthly subscriptions:

1. Go to **+ > Metrics > Formula**.
2. Click **Unnamed Metric**, and enter a name and description.
3. Input your custom NetScript logic to calculate total revenue in the metric block:

```auto
Metrics."Total Ad Revenue" + Metrics."Total Subscription Revenue" + Metrics."Total Purchase Revenue"
```

4. Click **Run**.
5. Click **Save**.

![opti-metrics-5.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/9_6BevTxN_I9t1b_Nkrr7-20260720-144931.png)

## Create metric presets

Within the **Presets** tab in **Metrics**, you can define universal display and behavior rules for your metric, eliminating the need for manual configuration in every report. You can configure the following presets:

- **Formatting** – This field lets you set the format for displaying the metric values. It includes multiple formats, including decimal, percentage, dates, and times. This is the only preset that applies to both experimentation and non-experimentation metrics. All other presets are applicable only to experimentation metrics.

![met-format.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/G5n1TIH3anokH_mhN30p8-20260720-144931.png)

- **Direction** – This field sets the expected direction of change for the metric. It indicates whether an increase in the metric value is considered a positive or negative change. This preset applies only to experimentation metrics.

![direction.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/V3oniThIpToqaWIIelF8T-20260720-144931.png)

- **Conversion window** – This field specifies the time frame within which conversions are counted after an event. It defines how long after an event a conversion can be attributed to it. This preset applies only to experimentation metrics.

![conversionwindownew.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/Hg7--UBuXh0xM83FZaPov-20260720-144931.png)

- **CUPED duration time interval** – This field defines the time interval for which [CUPED](docId\:XGaqMc2-oZfQBf5GHk2lS) is applied. This preset applies only to experimentation metrics.

![cupeddur.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/ObvFyS6B8QKuBbCa86K9q-20260720-144931.png)

- **Set alerts** – This field lets you set alerts based on threshold breaches. It lets you specify a threshold percentage at which an alert is triggered if the metric's value crosses it. This preset applies only to experimentation metrics.

![met-alerts.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/dbiQjrWgywnJ2SF6nCCaa-20260720-144932.png)

Use these steps to configure alerts:

1. Set the threshold in the **Alert when threshold is breached** field.
2. Add a visitor count in the **Alert only if users amount is more than** field.
3. Choose a list of users in the **Notify** field.
4. Check the **Alert only when statistical significance is reached** option so that alerts are only triggered if the indicated threshold was breached by a variation that reached statistical significance, reducing noise from early or incomplete data.

- **Outlier management** – This field provides options for [handling outliers](docId\:IzkWOkNtfZNnS3afFmYNV) in the metric data. It includes settings for the method used to manage outliers and the bounds for outlier detection. This preset applies only to experimentation metrics.

![met-out.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/j5RHqO5WSmeJUpIIXwjwO-20260720-144932.png)

## View reusable metrics[​](https://app.netspring.io/documentation/docs/Model%20Behavioral%20Semantics/metrics#view-metrics)[​](https://app.netspring.io/documentation/docs/Model%20Behavioral%20Semantics/metrics#metrics-page)

1. Click the **Home** icon.
2. Select the **Metrics** checkbox.
3. Use the search bar to find individual metrics by name.

You can find a paginated listing of metrics in the app. Each metric entry contains the following information:

- Name (with description, if any)
- Created by
- Updated by
- Updated at
- Type (refers to the template used when defining the metric)

![opti-metrics-6.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/Xf53CbDEjGbo42vEaFwR--20260720-144932.png)

## Edit reusable metrics

1. Click **Home**.
2. Select the **Metrics** checkbox.
3. Identify the metric you want to edit and click the **Name**.

## Delete reusable metrics

1. Click **Home**.
2. Select the **Metrics** checkbox.
3. Identify the metric you want to delete and click **More (⋮) > Delete**.
4. Click **Yes** to confirm.

Alternatively, click the **Name** to open the metric and click **More (⋮) > Delete**.
