Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
c8ae8f8
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
3f41001
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
1ea8351
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
de7b182
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
87bd951
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
4f2de5d
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
44c0ab5
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
ef431e2
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
5a39219
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
91331a4
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
5202455
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
5761090
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
0cc9281
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
b307fb4
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
35541e2
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
22661a1
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
8c80615
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
9f659d9
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
1ac2d0b
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
0c1424c
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
ec4cc8f
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
8ff5cd1
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
3db533c
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
1924113
Update references/metrics.mdx
mintlify[bot] Dec 10, 2025
5052ce3
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
3597be9
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
6a8a90d
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
10ad7cf
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
2f29ac3
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
20cce60
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
438cfba
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
927daeb
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
af403d4
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
1adb190
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
329de1f
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
75058da
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
90e43b5
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
719ad76
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
6889141
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
4568c62
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
8adb930
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
6b9259c
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
7b75d9b
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
2e5e598
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
4637497
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
dbbef5e
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
82334e2
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
b1b79fd
Update references/dimensions.mdx
mintlify[bot] Dec 10, 2025
4f7979a
Documentation edits made through Mintlify web editor
mintlify[bot] Dec 10, 2025
a6f1375
Documentation edits made through Mintlify web editor
mintlify[bot] Dec 10, 2025
95f337f
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
4d4354f
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
4917b00
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
33e7b5e
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
5b7be74
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
2fab3b9
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
b77c7af
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
dc502fb
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
526f8dd
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
9f79053
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
266f723
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
d395982
Update guides/formatting-your-fields.mdx
mintlify[bot] Dec 10, 2025
90d6042
Update guides/adding-tables-to-lightdash.mdx
mintlify[bot] Dec 10, 2025
d9e8f63
Update guides/explores.mdx
mintlify[bot] Dec 10, 2025
a503310
Update guides/explores.mdx
mintlify[bot] Dec 10, 2025
47e4934
Update get-started/develop-in-lightdash/how-to-create-dimensions.mdx
mintlify[bot] Dec 10, 2025
60957f6
Update get-started/develop-in-lightdash/how-to-create-dimensions.mdx
mintlify[bot] Dec 10, 2025
4a33669
Update get-started/develop-in-lightdash/how-to-create-metrics.mdx
mintlify[bot] Dec 10, 2025
7d3aee1
Update get-started/develop-in-lightdash/how-to-create-metrics.mdx
mintlify[bot] Dec 10, 2025
7e6bfe1
Update get-started/develop-in-lightdash/how-to-create-metrics.mdx
mintlify[bot] Dec 10, 2025
edff73b
Documentation edits made through Mintlify web editor
mintlify[bot] Dec 10, 2025
5c4a707
Update guides/period-over-period.mdx
mintlify[bot] Dec 10, 2025
3026cbf
Update guides/period-over-period.mdx
mintlify[bot] Dec 10, 2025
d2c050a
Update guides/period-over-period.mdx
mintlify[bot] Dec 10, 2025
b1032dc
Update guides/period-over-period.mdx
mintlify[bot] Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 57 additions & 22 deletions get-started/develop-in-lightdash/how-to-create-dimensions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,30 @@ We recommend using the CLI because it's faster and more reliable. But, if you're

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:

```yaml
models:
- name: Pages
description: "A table of all page views on Lightdash webpages."
columns:
- name: source
description: "The source of the page view: the demo site, docs site, or lightdash.com"
...
```
<Tabs>
<Tab title="dbt v1.9 and earlier">
```yaml
models:
- name: Pages
description: "A table of all page views on Lightdash webpages."
columns:
- name: source
description: "The source of the page view: the demo site, docs site, or lightdash.com"
...
```
</Tab>
<Tab title="dbt v1.10+ and Fusion">
```yaml
models:
- name: Pages
description: "A table of all page views on Lightdash webpages."
columns:
- name: source
description: "The source of the page view: the demo site, docs site, or lightdash.com"
...
```
</Tab>
</Tabs>

***

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

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`:

```yaml
models:
- name: orders
description: "A table of all orders."
columns:
- name: status
description: "Status from org256 settings codes. Referenced at delivery from stat5 zone."
meta:
dimension:
label: "Status latest"
description: "Status of an order: ordered/processed/complete"
...etc
```
<Tabs>
<Tab title="dbt v1.9 and earlier">
```yaml
models:
- name: orders
description: "A table of all orders."
columns:
- name: status
description: "Status from org256 settings codes. Referenced at delivery from stat5 zone."
meta:
dimension:
label: "Status latest"
description: "Status of an order: ordered/processed/complete"
...etc
```
</Tab>
<Tab title="dbt v1.10+ and Fusion">
```yaml
models:
- name: orders
description: "A table of all orders."
columns:
- name: status
description: "Status from org256 settings codes. Referenced at delivery from stat5 zone."
config:
meta:
dimension:
label: "Status latest"
description: "Status of an order: ordered/processed/complete"
...etc
```
</Tab>
</Tabs>

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

Expand Down
160 changes: 114 additions & 46 deletions get-started/develop-in-lightdash/how-to-create-metrics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,50 @@ If dimensions segment your data into groups, metrics calculate interesting stati

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:

```yaml
models:
- name: 'orders'
description: 'A table of all orders.'
columns:
- name: 'status'
description: 'Status of an order: ordered/processed/complete'
- name: 'order_id'
meta:
metrics:
total_order_count:
type: count_distinct
- name: 'order_value'
meta:
metrics:
total_sales:
type: sum
```
<Tabs>
<Tab title="dbt v1.9 and earlier">
```yaml
models:
- name: 'orders'
description: 'A table of all orders.'
columns:
- name: 'status'
description: 'Status of an order: ordered/processed/complete'
- name: 'order_id'
meta:
metrics:
total_order_count:
type: count_distinct
- name: 'order_value'
meta:
metrics:
total_sales:
type: sum
```
</Tab>
<Tab title="dbt v1.10+ and Fusion">
```yaml
models:
- name: 'orders'
description: 'A table of all orders.'
columns:
- name: 'status'
description: 'Status of an order: ordered/processed/complete'
- name: 'order_id'
config:
meta:
metrics:
total_order_count:
type: count_distinct
- name: 'order_value'
config:
meta:
metrics:
total_sales:
type: sum
```
</Tab>
</Tabs>

You can [see the full list of metric types](/references/metrics#metric-types) that you can use in your Lightdash project.

Expand Down Expand Up @@ -68,17 +94,35 @@ We'd suggest starting out simple, like a `count` for a primary key in your table

For example:

```yaml
models:
- name: 'orders'
columns:
- name: 'status'
- name: 'order_id'
meta:
metrics:
total_order_count:
type: count
```
<Tabs>
<Tab title="dbt v1.9 and earlier">
```yaml
models:
- name: 'orders'
columns:
- name: 'status'
- name: 'order_id'
meta:
metrics:
total_order_count:
type: count
```
</Tab>
<Tab title="dbt v1.10+ and Fusion">
```yaml
models:
- name: 'orders'
columns:
- name: 'status'
- name: 'order_id'
config:
meta:
metrics:
total_order_count:
type: count
```
</Tab>
</Tabs>

### Preview your changes using `lightdash preview`

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

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`:

```yaml
models:
- name: "orders"
description: "A table of all orders."
columns:
- name: "status"
description: "Status of an order: ordered/processed/complete"
- name: "order_value"
meta:
metrics:
total_sales:
type: sum
label: "Total sales (USD)"
groups: ["Sales metrics"]
round: 2
...etc.
```
<Tabs>
<Tab title="dbt v1.9 and earlier">
```yaml
models:
- name: "orders"
description: "A table of all orders."
columns:
- name: "status"
description: "Status of an order: ordered/processed/complete"
- name: "order_value"
meta:
metrics:
total_sales:
type: sum
label: "Total sales (USD)"
groups: ["Sales metrics"]
round: 2
...etc.
```
</Tab>
<Tab title="dbt v1.10+ and Fusion">
```yaml
models:
- name: "orders"
description: "A table of all orders."
columns:
- name: "status"
description: "Status of an order: ordered/processed/complete"
- name: "order_value"
config:
meta:
metrics:
total_sales:
type: sum
label: "Total sales (USD)"
groups: ["Sales metrics"]
round: 2
...etc.
```
</Tab>
</Tabs>

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

Expand Down
23 changes: 17 additions & 6 deletions guides/adding-tables-to-lightdash.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,23 @@ There may be a specific set of models that you want include as Tables in Lightda

You can add tags to your YAML file like this:

```yaml
models:
- name: model_name
config:
tags: ['prod']
```
<Tabs>
<Tab title="dbt v1.9 and earlier">
```yaml
models:
- name: model_name
tags: ['prod']
```
</Tab>
<Tab title="dbt v1.10+ and Fusion">
```yaml
models:
- name: model_name
config:
tags: ['prod']
```
</Tab>
</Tabs>

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

Expand Down
Loading