Using data warehouse tables in experiments
Contents
If you have event-like data in a data warehouse table (e.g. purchases, subscriptions, usage records), you can use it directly as a metric in your experiment.
Setting up a data warehouse metric
When adding a metric to your experiment, select the Data warehouse tables category and pick your table.
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)


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 |