Skip to content

Commit e755ce1

Browse files
authored
Add use cases to readme (#6)
* Add use cases to readme * Update create-table-of-contents.yml * Don't run CI for markdown files * Update README.md * Auto update table of contents * explain why we're ignoring main branch Co-authored-by: joellabes <joellabes@users.noreply.github.com>
1 parent 45b977c commit e755ce1

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: Continuous Integration
22

33
on:
44
push:
5+
paths-ignore:
6+
- "**.md"
57
branches:
68
- "main"
79
pull_request:
10+
paths-ignore:
11+
- "**.md"
812

913
jobs:
1014
postgres:

.github/workflows/create-table-of-contents.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Update table of contents
33
# Controls when the workflow will run
44
on:
55
push:
6-
branches: '!main'
6+
branches-ignore: 'main' #protected branch
77
paths: ['README.md']
88

99
jobs:

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* [About](#about)
66
* [A note on refs](#warning-a-note-on-refs)
77
* [Usage](#usage)
8+
* [Inside of dbt Models](#inside-of-dbt-models)
9+
* [Via the interactive dbt server (coming soon)](#via-the-interactive-dbt-server-coming-soon)
810
* [Secondary calculations](#secondary-calculations)
911
* [Period over Period (<a href="/macros/secondary_calculations/secondary_calculation_period_over_period.sql">source</a>)](#period-over-period-source)
1012
* [Period to Date (<a href="/macros/secondary_calculations/secondary_calculation_period_to_date.sql">source</a>)](#period-to-date-source)
@@ -17,7 +19,7 @@
1719
* [Experimental behaviour](#-experimental-behaviour)
1820
* [Dimensions on calendar tables](#dimensions-on-calendar-tables)
1921

20-
<!-- Added by: runner, at: Thu Feb 10 01:29:12 UTC 2022 -->
22+
<!-- Added by: runner, at: Thu Feb 10 02:34:59 UTC 2022 -->
2123

2224
<!--te-->
2325

@@ -28,6 +30,8 @@ This dbt package generates queries based on [metrics](https://docs.getdbt.com/do
2830
To enable the dynamic referencing of models necessary for macro queries through the dbt Server, queries generated by this package do not participate in the DAG and `ref`'d nodes will not necessarily be built before they are accessed. Refer to the docs on [forcing dependencies](https://docs.getdbt.com/reference/dbt-jinja-functions/ref#forcing-dependencies) for more details.
2931

3032
# Usage
33+
34+
## Inside of dbt Models
3135
Access metrics [like any other macro](https://docs.getdbt.com/docs/building-a-dbt-project/jinja-macros#using-a-macro-from-a-package):
3236
```sql
3337
select *
@@ -48,6 +52,11 @@ from {{ metrics.metric(
4852
) }}
4953
```
5054

55+
You may want to materialize the results as a fixed table for querying.
56+
57+
## Via the interactive dbt server (coming soon)
58+
When the [dbt server](https://blog.getdbt.com/licensing-dbt/) is released later in 2022, you will be able to access these macros interactively, without needing to build each variant as a single dbt model. For more information, check out the [keynote presentation from Coalesce 2021](https://www.getdbt.com/coalesce-2021/keynote-the-metrics-system/)
59+
5160
# Secondary calculations
5261
Secondary calculations are window functions which act on the primary metric. You can use them to compare a metric's value to an earlier period and calculate year-to-date sums or rolling averages.
5362

@@ -158,4 +167,4 @@ from {{ metrics.metric(
158167
dimensions=['plan', 'country', 'is_weekend'],
159168
secondary_calcs=[]
160169
) }}
161-
```
170+
```

0 commit comments

Comments
 (0)