Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 committed Feb 5, 2024
1 parent aaab9a4 commit 1def6ff
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 55 deletions.
6 changes: 3 additions & 3 deletions website/docs/docs/build/metricflow-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ You can use the `dbt sl` prefix before the command name to execute them in the d
- [`list dimensions`](#list) — Lists unique dimensions for metrics.
- [`list dimension-values`](#list-dimension-values) — List dimensions with metrics.
- [`list entities`](#list-entities) — Lists all unique entities.
- [`query`](#query) — Query metrics, saved queries, and dimensions you want to see in the command line interface. Refer to [query examples](#query-examples) to help you get started.
- [`query`](#query) — Query metrics, Saved Queries, and dimensions you want to see in the command line interface. Refer to [query examples](#query-examples) to help you get started.

<!--below commands aren't supported in dbt cloud yet
- [`validate-configs`](#validate-configs) &mdash; Validates semantic model configurations.
Expand Down Expand Up @@ -437,8 +437,8 @@ mf query --saved-query <name> # In dbt Core
For example, if you use dbt Cloud and have a saved query named `new_customer_orders`, you would run `dbt sl query --saved-query new_customer_orders`.
:::info A note on querying saved queries
When querying [saved queries](/docs/build/saved-queries),you can use parameters such as `where`, `limit`, `order`, `compile`, and so on. However, keep in mind that you can't access `metric` or `group_by` parameters in this context. This is because they are predetermined and fixed parameters for saved queries, and you can't change them at query time. If you would like to query more metrics or dimensions, you can build the query using the standard format.
:::info A note on querying Saved Queries
When querying [Saved Queries](/docs/build/saved-queries),you can use parameters such as `where`, `limit`, `order`, `compile`, and so on. However, keep in mind that you can't access `metric` or `group_by` parameters in this context. This is because they are predetermined and fixed parameters for Saved Queries, and you can't change them at query time. If you would like to query more metrics or dimensions, you can build the query using the standard format.
:::
</TabItem>
Expand Down
15 changes: 8 additions & 7 deletions website/docs/docs/build/saved-queries.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
title: Saved queries
title: Saved Queries
id: saved-queries
description: "Saved queries are a way to save commonly used queries in MetricFlow. They can be used to save time and avoid writing the same query over and over again."
sidebar_label: "Saved queries"
description: "Saved Queries are a way to save commonly used queries in MetricFlow. They can be used to save time and avoid writing the same query over and over again."
sidebar_label: "Saved Queries"
tags: [Metrics, Semantic Layer]
---

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.
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.

### Exports and Saved Queries comparison

Saved queries are distinct from [Exports](/docs/use-dbt-semantic-layer/exports), which schedule and execute saved queries using [dbt Cloud's job scheduler](/docs/deploy/job-scheduler). The following table compares the features and usage of Exports and Saved Queries:
Saved Queries are distinct from [Exports](/docs/use-dbt-semantic-layer/exports), which schedule and execute Saved Queries using [dbt Cloud's job scheduler](/docs/deploy/job-scheduler). The following table compares the features and usage of Exports and Saved Queries:

| Feature | Exports | <div style={{width:'250px, text-align: center'}}>Saved Queries</div> |
| ----------- | ----------- | ---------------- |
Expand All @@ -24,6 +24,8 @@ The following is an example of a saved query:

All metrics in a saved query need to use the same dimensions in the `group_by` or `where` clauses.

<File name='saved_queries.yml'>

```yaml
saved_queries:
- name: p0_booking
Expand All @@ -38,6 +40,7 @@ saved_queries:
where:
- "{{ Dimension('listing__capacity_latest') }} > 3"
```
</File>
## Parameters
Expand Down Expand Up @@ -65,5 +68,3 @@ All metrics in a saved query need to use the same dimensions in the `group_by` o

- [Exports](/docs/use-dbt-semantic-layer/exports)
- [Set up the dbt Semantic Layer](/docs/use-dbt-semantic-layer/setup-sl)


10 changes: 5 additions & 5 deletions website/docs/docs/dbt-cloud-apis/sl-graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Dimension {
DimensionType = [CATEGORICAL, TIME]
```

**List saved queries**
**List Saved Queries**

```graphql
{
Expand Down Expand Up @@ -602,7 +602,7 @@ mutation {
}
```

**Querying compile SQL with saved queries**
**Querying compile SQL with Saved Queries**

This query includes the field `savedQuery` and generates the SQL based on a predefined [saved query](/docs/build/saved-queries),rather than dynamically building it from a list of metrics and groupings. You can use this for frequently used queries.

Expand All @@ -618,11 +618,11 @@ mutation {
}
```

:::info A note on querying saved queries
When querying [saved queries](/docs/build/saved-queries),you can use parameters such as `where`, `limit`, `order`, `compile`, and so on. However, keep in mind that you can't access `metric` or `group_by` parameters in this context. This is because they are predetermined and fixed parameters for saved queries, and you can't change them at query time. If you would like to query more metrics or dimensions, you can build the query using the standard format.
:::info A note on querying Saved Queries
When querying [Saved Queries](/docs/build/saved-queries),you can use parameters such as `where`, `limit`, `order`, `compile`, and so on. However, keep in mind that you can't access `metric` or `group_by` parameters in this context. This is because they are predetermined and fixed parameters for Saved Queries, and you can't change them at query time. If you would like to query more metrics or dimensions, you can build the query using the standard format.
:::

**Create query with saved queries**
**Create query with Saved Queries**

This takes the same inputs as the `createQuery` mutation, but includes the field `savedQuery`. You can use this for frequently used queries.

Expand Down
6 changes: 3 additions & 3 deletions website/docs/docs/dbt-cloud-apis/sl-jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ select * from {{
<detailsToggle alt_header="List saved queries">
You can use this example query to list all available saved queries in your dbt project.
You can use this example query to list all available Saved Queries in your dbt project.
**Command**
Expand Down Expand Up @@ -536,8 +536,8 @@ semantic_layer.query(metrics=['food_order_amount', 'order_gross_profit'],
select * from {{ semantic_layer.query(saved_query="new_customer_orders", limit=5, compile=True}}
```
:::info A note on querying saved queries
When querying [saved queries](/docs/build/saved-queries),you can use parameters such as `where`, `limit`, `order`, `compile`, and so on. However, keep in mind that you can't access `metric` or `group_by` parameters in this context. This is because they are predetermined and fixed parameters for saved queries, and you can't change them at query time. If you would like to query more metrics or dimensions, you can build the query using the standard format.
:::info A note on querying Saved Queries
When querying [Saved Queries](/docs/build/saved-queries),you can use parameters such as `where`, `limit`, `order`, `compile`, and so on. However, keep in mind that you can't access `metric` or `group_by` parameters in this context. This is because they are predetermined and fixed parameters for Saved Queries, and you can't change them at query time. If you would like to query more metrics or dimensions, you can build the query using the standard format.
:::
### Query a saved query
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: "New: Materialize saved queries with Exports"
description: "February 2024: Use Exports to schedule saved queries with with dbt Cloud and integration with additional tools."
sidebar_label: "New: Materialize saved queries with Exports"
sidebar_position: 09
tags: [Feb-2024]
date: 2024-02-dd
---

You can now use [Exports](/docs/use-dbt-semantic-layer/exports) to materialize saved queries in your data platform, on a schedule. It uses the dbt Cloud job scheduler to execute saved queries for reliable and fast data reporting.

Exports enable custom integration with additional tools that don't natively connect with the [dbt Semantic Layer](/docs/use-dbt-semantic-layer/dbt-sl), such as PowerBI.

Exports are available on dbt Cloud [Team or Enterprise](https://www.getdbt.com/pricing/) plans and dbt versions 1.7 or higher.

<Lightbox src="/img/docs/dbt-cloud/semantic-layer/deploy_exports.jpg" width="90%" title="Adding --include-saved-query to the dbt build command in your job execution settings." />
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The following list explains the new features, updates, and fixes for January 202

- **Conversion metrics** &mdash; New metric type that allows you to measure conversion events. For example, users who viewed a web page and then filled out a form. For more details, refer to [Conversion metrics](/docs/build/conversion).
- **Simplified dimension resolution** &mdash; Instead of specifying the fully qualified dimension name (for example, `order__user__country`) in the group by or filter expression, you now only need to provide the primary entity and dimensions name, like `user__county`.
- **Saved queries** &mdash; You can now query the [saved queries](/docs/build/saved-queries) you've defined in the dbt Semantic Layer using [Tableau](/docs/use-dbt-semantic-layer/tableau), [GraphQL API](/docs/dbt-cloud-apis/sl-graphql), [JDBC API](docs/dbt-cloud-apis/sl-jdbc), and the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation).
- **Saved Queries** &mdash; You can now query the [Saved Queries](/docs/build/saved-queries) you've defined in the dbt Semantic Layer using [Tableau](/docs/use-dbt-semantic-layer/tableau), [GraphQL API](/docs/dbt-cloud-apis/sl-graphql), [JDBC API](docs/dbt-cloud-apis/sl-jdbc), and the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation).

## Updates

Expand Down
2 changes: 1 addition & 1 deletion website/docs/docs/deploy/deployment-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dbt Cloud offers the easiest and most reliable way to run your dbt project in pr
- Identify the root cause of failures in deployment environments
- Maintain high-quality code and data in production
- Gain visibility into the health of deployment jobs, models, and tests
- Uses [exports](/docs/use-dbt-semantic-layer/exports) to materialize [saved queries](/docs/build/saved-queries) in your data platform for reliable and fast metric reporting
- Uses [Exports](/docs/use-dbt-semantic-layer/exports) to materialize [Saved Queries](/docs/build/saved-queries) in your data platform for reliable and fast metric reporting

Before continuing, make sure you understand dbt's approach to [deployment environments](/docs/deploy/deploy-environments).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import AvailIntegrations from '/snippets/_sl-partner-links.md';

### Custom integration

- You can create custom integrations using different languages and tools. We support connecting with JDBC, ADBC, and GraphQL APIs. For more info, check out [our examples on GitHub](https://github.com/dbt-labs/example-semantic-layer-clients/).
- You can also connect to tools that allow you to write SQL. These tools must meet one of the two criteria:
- Supports a generic JDBC driver option (such as DataGrip) or
- Uses Arrow Flight SQL JDBC driver version 12.0.0 or higher.
- [Exports](/docs/use-dbt-semantic-layer/exports) enable custom integration with additional tools that don't natively connect with the dbt Semantic Layer, such as PowerBI.
- Develop custom integrations using different languages and tools, supported through JDBC, ADBC, and GraphQL APIs. For more info, check out [our examples on GitHub](https://github.com/dbt-labs/example-semantic-layer-clients/).
- Connect to any tool that supports SQL queries. These tools must meet one of the two criteria:
- Offers a generic JDBC driver option (such as DataGrip) or
- Is compatible Arrow Flight SQL JDBC driver version 12.0.0 or higher.

## Related docs

Expand Down
2 changes: 1 addition & 1 deletion website/docs/docs/use-dbt-semantic-layer/dbt-sl.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ plan="dbt Cloud Team or Enterprise"

<Card
title="Materialize queries with Exports"
body="Use Exports to materialize saved queries within the data platform on a schedule."
body="Use Exports to materialize commonly used queries directly within your data platform, on a schedule."
link="/docs/use-dbt-semantic-layer/exports"
icon="dbt-bit"/>

Expand Down
Loading

0 comments on commit 1def6ff

Please sign in to comment.