Skip to content

Commit

Permalink
Update saved query documentation for MetricFlow release
Browse files Browse the repository at this point in the history
With the release of MetricFlow 0.203.0 and dbt-metricflow 0.4.0 we now have support for saved queries.

This commit removes the "coming soon" marker and updates the spec to match the final release version.
  • Loading branch information
tlento authored Nov 14, 2023
1 parent 185e977 commit 3f9863d
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions website/docs/docs/build/saved-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ sidebar_label: "Saved queries"
tags: [Metrics, Semantic Layer]
---

:::info Saved queries coming soon
Saved queries isn't currently available in MetricFlow but support is coming soon.
:::

Saved queries are a way to save commonly used queries in MetricFlow. You can group metrics, dimensions, and filters that are logically related into a saved query.

To define a saved query, refer to the following specification:
Expand All @@ -18,24 +14,23 @@ To define a saved query, refer to the following specification:
| --------- | ----------- | ---- |
| `name` | The name of the metric. | Required |
| `description` | The description of the metric. | Optional |
| `metrics` | The metrics included in the saved query. | Required |
| `group_bys` | The value displayed in downstream tools. | Required |
| `where` | Filter applied to the query. | Optional |
| `query_params` | The query parameters for the saved query: `metrics`, `group_by`, and `where`. | Required |

The following is an example of a saved query:

```yaml
saved_query:
name: p0_booking
description: Booking-related metrics that are of the highest priority.
metrics:
- bookings
- instant_bookings
group_bys:
- TimeDimension('metric_time', 'day')
- Dimension('listing__capacity_latest')
where:
- "{{ Dimension('listing__capacity_latest') }} > 3"
query_params:
metrics:
- bookings
- instant_bookings
group_bys:
- TimeDimension('metric_time', 'day')
- Dimension('listing__capacity_latest')
where:
- "{{ Dimension('listing__capacity_latest') }} > 3"
```
### FAQs
Expand Down

0 comments on commit 3f9863d

Please sign in to comment.