From 78d3664c503f9ff84d33aeb14b094c20de2ca561 Mon Sep 17 00:00:00 2001
From: "inkeep[bot]" <257615677+inkeep[bot]@users.noreply.github.com>
Date: Sun, 5 Apr 2026 01:08:30 +0000
Subject: [PATCH 1/2] docs: add multiple DAGs section to Creating views page
Reflects PR #51873 which adds frontend support for multiple DAGs in
data modeling. Teams can now organize views into separate DAGs by
product area or environment.
---
contents/docs/data-warehouse/views/index.mdx | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/contents/docs/data-warehouse/views/index.mdx b/contents/docs/data-warehouse/views/index.mdx
index 5dd197798618..b62c1ef85de5 100644
--- a/contents/docs/data-warehouse/views/index.mdx
+++ b/contents/docs/data-warehouse/views/index.mdx
@@ -12,7 +12,7 @@ In the PostHog data warehouse, you can save your most used queries as **views**
## 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.
+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 how you access the fields on the view. This also means that we cannot use `SELECT *...` type SQL syntax for a query we would like to be a view since none of the columns are aliased.
@@ -20,9 +20,15 @@ For a query to be a valid view, all fields being accessed must be aliased (with

+## Organizing views with DAGs
+
+Views are organized into directed acyclic graphs (DAGs) that represent the relationships and dependencies between your models. You can have multiple DAGs to separate your views by product area (like finance, marketing, or analytics) or by environment (like dev, staging, and prod).
+
+When saving a view, you can select an existing DAG from the **Add to DAG** dropdown or create a new one by selecting **+ Create new DAG** and entering a name, description, and sync frequency. You can view and switch between DAGs in the **Data modeling** tab using the DAG selector.
+
## Extending PostHog models with views
-Views are a powerful tool for extending existing PostHog models for easier data access. For example, if you wanted to associate your Stripe customer data with product usage data of your users, you would normally need to manually set up a join. With views, you can attach views to PostHog models so that you can directly access those fields on the PostHog table.
+Views are a powerful tool for extending existing PostHog models for easier data access. For example, if you wanted to associate your Stripe customer data with product usage data of your users, you would normally need to manually set up a join. With views, you can attach views to PostHog models so that you can directly access those fields on the PostHog table.
To link a view to a [PostHog table](/docs/data-warehouse/sources/posthog), go to the [data warehouse section](https://app.posthog.com/data-warehouse/posthog), select the PostHog tab, and click **Link table to view**. Select your tables, keys to join, and press save. Once done, when you query that PostHog table, you can access the data from your view.
@@ -31,4 +37,3 @@ To link a view to a [PostHog table](/docs/data-warehouse/sources/posthog), go to
## Materializing views
Views can also be materialized and stored in the PostHog data warehouse, offering significant query performance benefits and improvements. You can learn more in the [materializing views](/docs/data-warehouse/views/materialize) guide.
-
From 8d4dcf2ce0c4ce9ef31e38c5e949a23d856ea424 Mon Sep 17 00:00:00 2001
From: "inkeep[bot]" <257615677+inkeep[bot]@users.noreply.github.com>
Date: Sun, 5 Apr 2026 01:09:53 +0000
Subject: [PATCH 2/2] docs: add section on saving queries as views with DAG
assignment
---
contents/docs/data-warehouse/query.mdx | 34 ++++++++++++++------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/contents/docs/data-warehouse/query.mdx b/contents/docs/data-warehouse/query.mdx
index ba537bea5983..552d109fd019 100644
--- a/contents/docs/data-warehouse/query.mdx
+++ b/contents/docs/data-warehouse/query.mdx
@@ -8,17 +8,17 @@ availability:
enterprise: full
---
-import { ProductScreenshot } from 'components/ProductScreenshot'
-import { CalloutBox } from 'components/Docs/CalloutBox'
+import { ProductScreenshot } from "components/ProductScreenshot";
+import { CalloutBox } from "components/Docs/CalloutBox";
PostHog provides the full flexibility of SQL to query your data warehouse using the [SQL editor](/docs/data-warehouse/sql).
To create a query, go to the [SQL editor](https://us.posthog.com/sql). Here you can see and search the schema of all available sources and [PostHog tables](/docs/data-warehouse/sources/posthog) as well as saved views.
@@ -29,9 +29,9 @@ Here you can:
3. Modify your query using [SQL commands](/docs/data-warehouse/sql) and [functions](/docs/data-warehouse/sql/useful-functions) as needed to get the data you want like `select amount / 100 as dollar_charge, status from stripe.prod.charge`.
@@ -41,7 +41,7 @@ Here you can:
- [PostHog AI](/docs/posthog-ai) can help write SQL for you. Just click the icon in the corner of your screen and ask it to write or tweak your query for you.
+[PostHog AI](/docs/posthog-ai) can help write SQL for you. Just click the icon in the corner of your screen and ask it to write or tweak your query for you.
@@ -61,17 +61,21 @@ By clicking on the **Visualization** tab below the query, you can customize the
For example, with tables, you can add conditional formatting rules. These enable you to highlight cells based on their value and are set up in the **Conditional formatting** tab.
+## Saving queries as views
+
+You can save frequently used queries as [views](/docs/data-warehouse/views) and reference them in subsequent queries. When saving a view, you can also assign it to a DAG (directed acyclic graph) to organize your data models by product area (like finance, marketing, or analytics) or by environment (like dev, staging, and prod). See the [creating views](/docs/data-warehouse/views) docs for more details.
+
## Querying multiple sources together
-Much of the power of the data warehouse comes from combining multiple sources, like your Stripe or Hubspot data with your product analytics data. Two of the easiest ways of doing this are `WHERE IN` and `JOIN` SQL commands.
+Much of the power of the data warehouse comes from combining multiple sources, like your Stripe or Hubspot data with your product analytics data. Two of the easiest ways of doing this are `WHERE IN` and `JOIN` SQL commands.
-import QueryJoinExample from './_snippets/query-join-example.mdx'
+import QueryJoinExample from "./_snippets/query-join-example.mdx";
@@ -97,6 +101,6 @@ These metrics are helpful for optimizing queries, especially when working with l
## Optimizing queries
-import OptimalQueries from '../_snippets/optimal-queries.mdx'
+import OptimalQueries from "../_snippets/optimal-queries.mdx";
-
\ No newline at end of file
+