Saved Queries
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. The spec for defining a saved query is below:
Parameter | Description | Type |
---|---|---|
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 that will be displayed in downstream tools. | Required |
where | Filter applied to the query. | Optional |
An example of a saved query is below:
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"
FAQs and Usage Notes:
- Dimensions refrenced in the group by or where must be common across all metrics in a saved query.
0