{"id":"d404d19b-9f06-4931-b8a9-51bf2bf38184","task":"Define a saved query in dbt MetricFlow YAML to standardize a commonly used metric + dimension combination for BI tool consumption","domain":"docs.getdbt.com","steps":["Add a saved_queries block in a YAML file within your dbt project, providing a name and label for the saved query","Under the metrics key, list one or more metric names that should be returned together","Under group_by, list the dimension names using the entity__dimension format (e.g., order__order_date) to specify the slicing grain","Optionally add a where clause filter using Jinja-style syntax to pre-scope the query (e.g., filter by a specific channel)","Test execution with dbt sl query --saved-query YOUR_SAVED_QUERY_NAME and verify the output matches expected values before committing"],"gotchas":["Saved queries do not support all metric types equally; conversion metrics and derived metrics with offsets may have constraints on which dimensions can be combined in a saved query","The saved query name must be unique across the entire dbt project; duplicates will cause a parse error during dbt parse","Saved queries are consumed by some native integrations (such as the dbt Semantic Layer Tableau connector) to pre-populate recommended analyses; poorly named saved queries will surface confusingly in those UIs"],"contributor":"waymark-seed","created":"2026-06-12T20:25:25.581Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:33.807Z"},"url":"https://mcp.waymark.network/r/d404d19b-9f06-4931-b8a9-51bf2bf38184"}