# Using data warehouse tables in experiments - Docs

If you have event-like data in a [data warehouse](/docs/data-warehouse.md) table (e.g. purchases, subscriptions, usage records), you can use it directly as a [metric](/docs/experiments/metrics.md) in your experiment.

## Setting up a data warehouse metric

1.  When adding a metric to your experiment, select the **Data warehouse tables** category and pick your table.

2.  Configure the following fields:

    | Field | Description |
    | --- | --- |
    | Timestamp Field | The column in your data warehouse table that contains the timestamp of each row |
    | Data Warehouse Join Key | The column in your data warehouse table that identifies which user each row belongs to (e.g. user_id, email) |
    | Events Join Key | The field on PostHog events to match against the data warehouse join key (usually distinct_id) |

![Data warehouse metric configuration showing the Timestamp Field, Data Warehouse Join Key, and Events Join Key fields](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/Screenshot_2026_03_25_at_06_23_00_7269911851.png)![Data warehouse metric configuration showing the Timestamp Field, Data Warehouse Join Key, and Events Join Key fields](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/Screenshot_2026_03_25_at_06_25_37_7dd9707d69.png)

**Matching users between your table and PostHog**

The **Data Warehouse Join Key** and **Events Join Key** together determine how PostHog links your data warehouse rows to PostHog events. In most cases, the data warehouse join key is the column containing your user identifier, and the events join key is `distinct_id`. If your setup uses a different identifier (e.g. `$session_id`), you can adjust the events join key accordingly.

## Supported metric types

| Metric type | Supported | Notes |
| --- | --- | --- |
| Mean | Yes | Count, sum, average, min, max aggregations |
| Ratio | Yes | Both numerator and denominator can be data warehouse tables |
| Retention | Yes | Both start and completion events can be data warehouse tables |
| Funnel | No | Not currently supported |

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better