Filtering, visualizing, and joining data

Last updated:

|Edit this page

Once you link a source, your external data can be used alongside the rest of the PostHog.

Visualizing

Data synced to the data warehouse is available for use in insights, just as events and actions are. You can select your data warehouse data as a series in the dropdown when creating an insight.

Selecting data warehouse data

The main difference from events is that you must identify 3 fields from the data warehouse data to visualize it:

  • ID: A field that corresponds to the ID of the element.
  • Distinct ID: A field that corresponds to an ID representing the user associated with the element. If none, can match ID.
  • Timestamp: A timestamp field representing when the element was created.

It's infeasible for us to map these fields. We pre-fill with a best guess, but allow you to edit it.

Filtering

Once you select a data warehouse table to visualize, you can filter on the related data in the schema under the insight specific filter dropdown.

Joining

You can join external data on existing PostHog schemas and other external data tables. These joins are saved and interpreted anytime they're accessed on the origin table. For example, if you import your Stripe data, get a table stripe_customers, and define a join between events and stripe_customers, you can then query SELECT stripe_customers.id FROM events.

To define a join, go to the data warehouse tab, select the origin table of the join, click "Add join", and define the join parameters.

Create a join

Special Joins

Joining data warehouse data against the PostHog persons schema enables the data to be used as person filters within an insight.

Filter on joined person properties

Questions?

Was this page useful?

Next article

Creating views

In the PostHog data warehouse, you can save your most used queries as views and reference them in subsequent queries. Creating a view Query views are created directly inside SQL insights. If the query has valid view characteristics, the "Save as view" button is enabled. When clicked, you are prompted to give the view a name which can then be referenced in other queries. For a query to be a valid view, all fields being accessed must be aliased (with the SQL as keyword). The alias names are…

Read next article