Skip to content

Commit d212578

Browse files
Updated dbt code examples to support both v1.9 and v1.10+ syntax (#271)
* Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update references/dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Documentation edits made through Mintlify web editor * Documentation edits made through Mintlify web editor * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/formatting-your-fields.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/adding-tables-to-lightdash.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/explores.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/explores.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update get-started/develop-in-lightdash/how-to-create-dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update get-started/develop-in-lightdash/how-to-create-dimensions.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update get-started/develop-in-lightdash/how-to-create-metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update get-started/develop-in-lightdash/how-to-create-metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update get-started/develop-in-lightdash/how-to-create-metrics.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Documentation edits made through Mintlify web editor * Update guides/period-over-period.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/period-over-period.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/period-over-period.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * Update guides/period-over-period.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> * various updadtes and fixes --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> Co-authored-by: Jake Peterson <5532776+jpetey75@users.noreply.github.com>
1 parent dfd8e82 commit d212578

File tree

8 files changed

+2934
-1118
lines changed

8 files changed

+2934
-1118
lines changed

get-started/develop-in-lightdash/how-to-create-dimensions.mdx

Lines changed: 57 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,30 @@ We recommend using the CLI because it's faster and more reliable. But, if you're
7676

7777
For example, if I had a column in my dbt model called `source` and I wanted to add it as a dimension to Lightdash, I would just add the column to my .yml file like so:
7878

79-
```yaml
80-
models:
81-
- name: Pages
82-
description: "A table of all page views on Lightdash webpages."
83-
columns:
84-
- name: source
85-
description: "The source of the page view: the demo site, docs site, or lightdash.com"
86-
...
87-
```
79+
<Tabs>
80+
<Tab title="dbt v1.9 and earlier">
81+
```yaml
82+
models:
83+
- name: Pages
84+
description: "A table of all page views on Lightdash webpages."
85+
columns:
86+
- name: source
87+
description: "The source of the page view: the demo site, docs site, or lightdash.com"
88+
...
89+
```
90+
</Tab>
91+
<Tab title="dbt v1.10+ and Fusion">
92+
```yaml
93+
models:
94+
- name: Pages
95+
description: "A table of all page views on Lightdash webpages."
96+
columns:
97+
- name: source
98+
description: "The source of the page view: the demo site, docs site, or lightdash.com"
99+
...
100+
```
101+
</Tab>
102+
</Tabs>
88103

89104
***
90105

@@ -108,19 +123,39 @@ Then `cmd` + `click` to open the preview link from your terminal. Once you're in
108123

109124
You can jazz up your dimensions by configuring them in your .yml files. These dimension configurations live under the `meta` tag of your columns, under `dimension`:
110125

111-
```yaml
112-
models:
113-
- name: orders
114-
description: "A table of all orders."
115-
columns:
116-
- name: status
117-
description: "Status from org256 settings codes. Referenced at delivery from stat5 zone."
118-
meta:
119-
dimension:
120-
label: "Status latest"
121-
description: "Status of an order: ordered/processed/complete"
122-
...etc
123-
```
126+
<Tabs>
127+
<Tab title="dbt v1.9 and earlier">
128+
```yaml
129+
models:
130+
- name: orders
131+
description: "A table of all orders."
132+
columns:
133+
- name: status
134+
description: "Status from org256 settings codes. Referenced at delivery from stat5 zone."
135+
meta:
136+
dimension:
137+
label: "Status latest"
138+
description: "Status of an order: ordered/processed/complete"
139+
...etc
140+
```
141+
</Tab>
142+
<Tab title="dbt v1.10+ and Fusion">
143+
```yaml
144+
models:
145+
- name: orders
146+
description: "A table of all orders."
147+
columns:
148+
- name: status
149+
description: "Status from org256 settings codes. Referenced at delivery from stat5 zone."
150+
config:
151+
meta:
152+
dimension:
153+
label: "Status latest"
154+
description: "Status of an order: ordered/processed/complete"
155+
...etc
156+
```
157+
</Tab>
158+
</Tabs>
124159

125160
Things like the format, the label that people see in Lightdash, rounding, etc. - these are all configurations that you can apply to your dimensions.
126161

get-started/develop-in-lightdash/how-to-create-metrics.mdx

Lines changed: 114 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,50 @@ If dimensions segment your data into groups, metrics calculate interesting stati
1212

1313
For example, if we have a dimension, `status`, to split orders by their `status`, we may want to know the "Total number of orders" or the "Total sales" of the orders. These calculations are metrics:
1414

15-
```yaml
16-
models:
17-
- name: 'orders'
18-
description: 'A table of all orders.'
19-
columns:
20-
- name: 'status'
21-
description: 'Status of an order: ordered/processed/complete'
22-
- name: 'order_id'
23-
meta:
24-
metrics:
25-
total_order_count:
26-
type: count_distinct
27-
- name: 'order_value'
28-
meta:
29-
metrics:
30-
total_sales:
31-
type: sum
32-
```
15+
<Tabs>
16+
<Tab title="dbt v1.9 and earlier">
17+
```yaml
18+
models:
19+
- name: 'orders'
20+
description: 'A table of all orders.'
21+
columns:
22+
- name: 'status'
23+
description: 'Status of an order: ordered/processed/complete'
24+
- name: 'order_id'
25+
meta:
26+
metrics:
27+
total_order_count:
28+
type: count_distinct
29+
- name: 'order_value'
30+
meta:
31+
metrics:
32+
total_sales:
33+
type: sum
34+
```
35+
</Tab>
36+
<Tab title="dbt v1.10+ and Fusion">
37+
```yaml
38+
models:
39+
- name: 'orders'
40+
description: 'A table of all orders.'
41+
columns:
42+
- name: 'status'
43+
description: 'Status of an order: ordered/processed/complete'
44+
- name: 'order_id'
45+
config:
46+
meta:
47+
metrics:
48+
total_order_count:
49+
type: count_distinct
50+
- name: 'order_value'
51+
config:
52+
meta:
53+
metrics:
54+
total_sales:
55+
type: sum
56+
```
57+
</Tab>
58+
</Tabs>
3359
3460
You can [see the full list of metric types](/references/metrics#metric-types) that you can use in your Lightdash project.
3561
@@ -68,17 +94,35 @@ We'd suggest starting out simple, like a `count` for a primary key in your table
6894

6995
For example:
7096

71-
```yaml
72-
models:
73-
- name: 'orders'
74-
columns:
75-
- name: 'status'
76-
- name: 'order_id'
77-
meta:
78-
metrics:
79-
total_order_count:
80-
type: count
81-
```
97+
<Tabs>
98+
<Tab title="dbt v1.9 and earlier">
99+
```yaml
100+
models:
101+
- name: 'orders'
102+
columns:
103+
- name: 'status'
104+
- name: 'order_id'
105+
meta:
106+
metrics:
107+
total_order_count:
108+
type: count
109+
```
110+
</Tab>
111+
<Tab title="dbt v1.10+ and Fusion">
112+
```yaml
113+
models:
114+
- name: 'orders'
115+
columns:
116+
- name: 'status'
117+
- name: 'order_id'
118+
config:
119+
meta:
120+
metrics:
121+
total_order_count:
122+
type: count
123+
```
124+
</Tab>
125+
</Tabs>
82126

83127
### Preview your changes using `lightdash preview`
84128

@@ -98,23 +142,47 @@ Then `cmd` + `click` to open the preview link from your terminal. Once you're in
98142

99143
You can jazz up your metrics by configuring them in your .yml files. These metric configurations live under the `meta` tag of your columns, under `metrics`:
100144

101-
```yaml
102-
models:
103-
- name: "orders"
104-
description: "A table of all orders."
105-
columns:
106-
- name: "status"
107-
description: "Status of an order: ordered/processed/complete"
108-
- name: "order_value"
109-
meta:
110-
metrics:
111-
total_sales:
112-
type: sum
113-
label: "Total sales (USD)"
114-
groups: ["Sales metrics"]
115-
round: 2
116-
...etc.
117-
```
145+
<Tabs>
146+
<Tab title="dbt v1.9 and earlier">
147+
```yaml
148+
models:
149+
- name: "orders"
150+
description: "A table of all orders."
151+
columns:
152+
- name: "status"
153+
description: "Status of an order: ordered/processed/complete"
154+
- name: "order_value"
155+
meta:
156+
metrics:
157+
total_sales:
158+
type: sum
159+
label: "Total sales (USD)"
160+
groups: ["Sales metrics"]
161+
round: 2
162+
...etc.
163+
```
164+
</Tab>
165+
<Tab title="dbt v1.10+ and Fusion">
166+
```yaml
167+
models:
168+
- name: "orders"
169+
description: "A table of all orders."
170+
columns:
171+
- name: "status"
172+
description: "Status of an order: ordered/processed/complete"
173+
- name: "order_value"
174+
config:
175+
meta:
176+
metrics:
177+
total_sales:
178+
type: sum
179+
label: "Total sales (USD)"
180+
groups: ["Sales metrics"]
181+
round: 2
182+
...etc.
183+
```
184+
</Tab>
185+
</Tabs>
118186

119187
Things like the format, the label that people see in Lightdash, rounding, etc. - these are all configurations that you can apply to your metrics.
120188

guides/adding-tables-to-lightdash.mdx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,23 @@ There may be a specific set of models that you want include as Tables in Lightda
176176

177177
You can add tags to your YAML file like this:
178178

179-
```yaml
180-
models:
181-
- name: model_name
182-
config:
183-
tags: ['prod']
184-
```
179+
<Tabs>
180+
<Tab title="dbt v1.9 and earlier">
181+
```yaml
182+
models:
183+
- name: model_name
184+
tags: ['prod']
185+
```
186+
</Tab>
187+
<Tab title="dbt v1.10+ and Fusion">
188+
```yaml
189+
models:
190+
- name: model_name
191+
config:
192+
tags: ['prod']
193+
```
194+
</Tab>
195+
</Tabs>
185196

186197
Or, to your model's SQL file in the config block:
187198

0 commit comments

Comments
 (0)