Skip to content

Commit

Permalink
Merge branch 'current' into amada-ech-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
nghi-ly authored Nov 14, 2023
2 parents 1ccad6c + 416f2c7 commit 06fdc8f
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 06fdc8f

Please sign in to comment.