
Aggregated Metrics (fka Warehouse Metrics) let you import precomputed metrics directly from your data warehouse into Amplitude, keeping your source of truth consistent with your analytics.

Unlike event-based metrics that Amplitude calculates from behavioral data, Aggregated Metrics (fka Warehouse Metrics) sync pre-calculated values from your warehouse. You can use business metrics like revenue, customer lifetime value, health scores, and financial KPIs alongside behavioral data in Amplitude's analytics and experimentation tools.

{% callout type="note" %}
To gain access, contact your Amplitude Client Success Manager.
{% /callout %}

## How Aggregated Metrics (fka Warehouse Metrics) work

Aggregated Metrics (fka Warehouse Metrics) sync on a recurring schedule from tables in your data warehouse. Each row should include the following:

- **Time**: When the metric value is valid.
- **User identifier**: The `user_id` or `device_id` to which the metric applies.
- **Insert identifier**: An optional unique identifier for deduplication.
- **Metric values**: Numeric values (like revenue: 13423, count: 50).
- **Dimensions** (optional): Categorical attributes (like `health_score`: `"green"`, or `paid: true`).

## Requirements

- An Amplitude project.
- Read access to your Snowflake instance.
- A table or view that contains metric values with timestamps and user identifiers.
- Change Data Capture (CDC) enabled for your metrics table.

{% callout type="note" heading="Anonymous user support" %}
Aggregated Metrics (fka Warehouse Metrics) support both identified users (`user_id`) and anonymous users (`device_id`).  
{% /callout %}

## Metric types

Aggregated Metrics (fka Warehouse Metrics) supports these aggregation types on values:

- **Sum**: Total of all values.
- **Average**: Mean value across per-user sums.
- **Min**: Minimum value.
- **Max**: Maximum value.

For more information, refer to [Warehouse Metric Calculations](/docs/data/warehouse-metric-calculations).

## Data types

- **Metrics**: Numeric values only (integers, decimals).
- **Dimensions**: String, number, or boolean values for grouping and filtering.

{% callout type="note" heading="" %}
Metrics require the source data to be numeric.
{% /callout %}

## Common use cases

Aggregated Metrics (fka Warehouse Metrics) solve challenges where business metrics are difficult or impossible to calculate natively in Amplitude:

### Revenue and financial metrics

- **Average Order Value (AOV)**: Precomputed.
- **Credits Remaining/Used**: Account balance tracking.

These metrics often require data that's too high-volume, sensitive, or non-event-based to send to Amplitude efficiently.

### Customer health metrics

- **Customer Lifetime Value (LTV)**: Forward-looking revenue projections.
- **Health Scores**: Composite metrics from multiple data sources.
- **Churn Risk**: Machine learning predictions from your warehouse.

These metrics require modeling and forecasting that happens in your data warehouse.

### State metrics

- **Activation Status**: User onboarding state.
- **Subscription Tier**: Current plan level.
- **Beta Group Membership**: Feature access flags.
- **Experiment Exposure**: Assignment tracking.

These metrics track current user state rather than discrete events.

## Import metric data

Aggregated Metrics (fka Warehouse Metrics) supports Snowflake.

### Enable change tracking

If this is your first time importing from this table, enable change tracking in Snowflake:

```sql
ALTER TABLE YOUR_DATABASE.YOUR_SCHEMA.YOUR_METRICS_TABLE
  SET DATA_RETENTION_TIME_IN_DAYS = 7;

ALTER TABLE YOUR_DATABASE.YOUR_SCHEMA.YOUR_METRICS_TABLE
  SET CHANGE_TRACKING = TRUE;
```

{% callout type="note" heading="Snowflake Standard Edition" %}
On Snowflake Standard Edition, the maximum retention time is one day. Set your sync frequency to 12 hours.  
{% /callout %}

### Connect and configure

Follow the instructions in [Snowflake Data Import ](/docs/data/source-catalog/snowflake#add-and-configure-the-snowflake-source) to connect to your Snowflake instance.

## Data specifications

Your metrics table must include specific required fields and can optionally include additional fields. At least one metric or dimension field is required.

### Required fields

| Field                    | Description                               | Example      |
| ------------------------ | ----------------------------------------- | ------------ |
| `time`                   | When the metric value is valid            | `1762813185` |
| `user_id` or `device_id` | A unique identifier for a user or device. | `user_12345` |

{% callout type="note" heading="Time conversion" %}
Amplitude requires that the incoming time is represented in milliseconds from Unix epoch. Use Snowflake’s built-in conversion functions or other tooling in your data pipeline to convert to this format before Amplitude ingests the data.  
{% /callout %}

### Optional fields

| Field       | Description                            | Example                                |
| ----------- | -------------------------------------- | -------------------------------------- |
| `insert_id` | A unique identifier for deduplication. | `51a87950-b35d-4a2f-b919-af92f00f75dd` |

### Metric fields

Your metrics table must include at least one metric or dimension field.

| Field Type | Description                                       | Example                  |
| ---------- | :------------------------------------------------ | ------------------------ |
| Metric     | Numeric value (integer or decimal)                | `150.25`                 |
| Dimension  | String, boolean, or number for filtering/grouping | `"active"`, `true`, `10` |

### Example

```json
{
  "time": "1762813185",
  "user_id": "user_12345",
  "total_revenue": 1543.5,
  "order_count": 12,
  "ltv": 15430.0,
  "health_score": "green",
  "is_paid": true
}
```

## Query template

```sql
SELECT
  event_date AS "time",
  user_id AS "user_id",
  total_revenue AS "total_revenue",
  order_count AS "order_count",
  ltv AS "ltv",
  health_score AS "health_score",
  is_paid_customer AS "is_paid"
FROM DATABASE_NAME.SCHEMA_NAME.METRICS_TABLE
WHERE event_date >= CURRENT_DATE - INTERVAL '30 days'
```

## Add your metric to an experiment

Use Aggregated Metrics (fka Warehouse Metrics) in end-to-end experiments or experiment results as:

- **Goals**: Measure impact on business metrics.
- **Analysis metrics**: Understand how experiments affect revenue, LTV, and other KPIs.

When you create or edit an experiment, select metrics from the Warehouse source in the metrics picker.

{% callout type="note" heading="Last synced information" %}
Aggregated Metrics (fka Warehouse Metrics) display when they were last synced and the next scheduled sync.  
{% /callout %}

##### Creating a warehouse metric in your experiment

1. In the experiment, navigate to the **Metrics** panel.
2. Click **Create a custom metric**.
3. Enter a **Name** and **Description** for the metric.
4. Click the **Warehouse** tab.
5. Select the table you specified during data import.
6. Define the metric. Choose **Sum**, **User Average**, **Min**, or **Max**.
7. Select the column in the table you want to combine using the definition you selected.
8. Preview the results and click **Save**.

{% callout type="tip" heading="" %}
Aggregated Metrics (fka Warehouse Metrics) you created before are available in the **Add Metric** dialog. You don't need to recreate them.
{% /callout %}

## Best practices

1. **Define metrics once**: Create metrics in your warehouse and reference them everywhere in Amplitude.
2. **Use descriptive names**: Name metrics clearly (like "Average Order Value" not "metric_1").
3. **Include descriptions**: Add descriptions in the Metrics creation flow to help users understand what each metric measures.
4. **Start with key metrics**: Begin with 5-10 critical metrics before expanding.

## Troubleshooting

If you encounter issues with Aggregated Metrics (fka Warehouse Metrics), these common problems and solutions can help you resolve them.

### Sync failures

- Ensure data retention period is at least seven days, unless you use Snowflake Standard Edition, then set it to one day.
- Verify warehouse credentials haven't expired.
- Check that the table structure hasn't changed.
- Ensure Change Data Capture (CDC) is enabled in your Snowflake table or view.
- Verify the sync completed successfully in the activity log.

## Limitations

- Aggregated Metrics (fka Warehouse Metrics) require a unique user identifier per row.
- Metric values can only be numeric (dimensions can be strings, numbers, or booleans).
- Each metric represents a point-in-time value, not an event stream.
- Amplitude doesn't support rollup or combined tables without unique user identifiers.
- Aggregated Metrics (fka Warehouse Metrics) don't support CUPED or group by.

## Frequently asked questions

### Using Aggregated Metrics (fka Warehouse Metrics) without sending events to Amplitude

Yes, but Aggregated Metrics (fka Warehouse Metrics) are most powerful when combined with behavioral events. You can create metric-only charts if needed.

### Differences between Aggregated Metrics (fka Warehouse Metrics) and profiles

Profiles sync current user attributes. Aggregated Metrics (fka Warehouse Metrics) sync time-series numeric values that you can combine, use as experiment goals, and visualize over time.
