You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/docs/build/metricflow-commands.md
+25-14Lines changed: 25 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Using MetricFlow with dbt Cloud means you won't need to manage versioning &mdash
25
25
26
26
<TabItemvalue="cloudcli"label="dbt Cloud CLI">
27
27
28
-
- MetricFlow commands are embedded in the dbt Cloud CLI. This means you can immediately run them once you install the dbt Cloud CLI and don't need to install MetricFlow separately.
28
+
- MetricFlow [commands](#metricflow-commands) are embedded in the dbt Cloud CLI. This means you can immediately run them once you install the dbt Cloud CLI and don't need to install MetricFlow separately.
29
29
- You don't need to manage versioning — your dbt Cloud account will automatically manage the versioning for you.
30
30
31
31
</TabItem>
@@ -36,21 +36,17 @@ Using MetricFlow with dbt Cloud means you won't need to manage versioning &mdash
36
36
You can create metrics using MetricFlow in the dbt Cloud IDE. However, support for running MetricFlow commands in the IDE will be available soon.
37
37
:::
38
38
39
-
40
-
41
39
</TabItem>
42
40
43
41
<TabItemvalue="core"label="dbt Core">
44
42
43
+
:::tip Use dbt Cloud CLI for semantic layer development
45
44
46
-
:::info Use dbt Cloud CLI for semantic layer development
47
-
48
-
Use the dbt Cloud CLI for the experience in defining and querying metrics in your dbt project on dbt Cloud or dbt Core with MetricFlow.
45
+
You can use the dbt Cloud CLI for the experience in defining and querying metrics in your dbt project.
49
46
50
47
A benefit to using the dbt Cloud is that you won't need to manage versioning — your dbt Cloud account will automatically manage the versioning.
51
48
:::
52
49
53
-
54
50
You can install [MetricFlow](https://github.com/dbt-labs/metricflow#getting-started) from [PyPI](https://pypi.org/project/dbt-metricflow/). You need to use `pip` to install MetricFlow on Windows or Linux operating systems:
55
51
56
52
1. Create or activate your virtual environment `python -m venv venv`
@@ -70,16 +66,16 @@ Something to note, MetricFlow `mf` commands return an error if you have a Metafo
70
66
MetricFlow provides the following commands to retrieve metadata and query metrics.
71
67
72
68
<Tabs>
73
-
<TabItemvalue="cloud"label="Commands for dbt Cloud">
69
+
<TabItemvalue="cloud"label="Commands for dbt Cloud CLI">
74
70
75
-
Use the `dbt sl` prefix before the command name to execute them in dbt Cloud. For example, to list all metrics, run `dbt sl list metrics`.
71
+
You can use the `dbt sl` prefix before the command name to execute them in the dbt Cloud CLI. For example, to list all metrics, run `dbt sl list metrics`.
-[`list metrics`](#list-metrics)— Lists metrics with dimensions.
79
75
-[`list dimensions`](#list)— Lists unique dimensions for metrics.
80
76
-[`list dimension-values`](#list-dimension-values)— List dimensions with metrics.
81
77
-[`list entities`](#list-entities)— Lists all unique entities.
82
-
-[`query`](#query)— Query metrics and dimensions you want to see in the command line interface. Refer to [query examples](#query-examples) to help you get started.
78
+
-[`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.
83
79
84
80
<!--below commands aren't supported in dbt cloud yet
85
81
- [`validate-configs`](#validate-configs) — Validates semantic model configurations.
@@ -226,10 +222,11 @@ mf tutorial # In dbt Core
226
222
227
223
### Query
228
224
229
-
Create a new query with MetricFlow, execute that query against the user's data platform, and return the result:
225
+
Create a new query with MetricFlow and execute it against your data platform. The query returns the following result:
230
226
231
227
```bash
232
228
dbt sl query --metrics <metric_name> --group-by <dimension_name># In dbt Cloud
229
+
dbt sl query --saved-query <name># In dbt Cloud CLI
233
230
234
231
mf query --metrics <metric_name> --group-by <dimension_name># In dbt Core
You can use this for frequently used queries. Replace `<name>` with the name of your [saved query](/docs/build/saved-queries).
430
+
431
+
**Query**
432
+
```bash
433
+
dbt sl query --saved-query <name># In dbt Cloud
434
+
435
+
mf query --saved-query <name> # In dbt Core
436
+
```
437
+
438
+
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`.
434
439
440
+
:::info A note on querying saved queries
441
+
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.
Copy file name to clipboardExpand all lines: website/docs/docs/cloud/manage-access/sso-overview.md
-4Lines changed: 0 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,6 @@ pagination_prev: null
8
8
This overview explains how users are provisioned in dbt Cloud via Single Sign-On (SSO).
9
9
dbt Cloud supports JIT (Just-in-Time) provisioning and IdP-initiated login. You can learn more about our supported options [here](https://www.getdbt.com/pricing/).
10
10
11
-
:::tip Configuring SSO
12
-
Once you configure SSO, even partially, you cannot disable or revert it. When you configure it, you will want to make sure you do so completely.
13
-
:::
14
-
15
11
## Prerequisites
16
12
17
13
- You have a dbt Cloud account enrolled in the Enterprise plan. [Contact us](mailto:[email protected]) to learn more and enroll.
Copy file name to clipboardExpand all lines: website/docs/docs/dbt-cloud-apis/sl-graphql.md
+60Lines changed: 60 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -217,6 +217,31 @@ Dimension {
217
217
DimensionType = [CATEGORICAL, TIME]
218
218
```
219
219
220
+
**List saved queries**
221
+
222
+
```graphql
223
+
{
224
+
savedQueries(environmentId: 200532) {
225
+
name
226
+
description
227
+
label
228
+
queryParams {
229
+
metrics {
230
+
name
231
+
}
232
+
groupBy {
233
+
name
234
+
grain
235
+
datePart
236
+
}
237
+
where {
238
+
whereSqlTemplate
239
+
}
240
+
}
241
+
}
242
+
}
243
+
```
244
+
220
245
### Querying
221
246
222
247
When querying for data, _either_ a `groupBy`_or_ a `metrics` selection is required.
@@ -576,3 +601,38 @@ mutation {
576
601
}
577
602
}
578
603
```
604
+
605
+
**Querying compile SQL with saved queries**
606
+
607
+
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.
608
+
609
+
```graphql
610
+
mutation {
611
+
compileSql(
612
+
environmentId: 200532
613
+
savedQuery: "new_customer_orders" # new field
614
+
) {
615
+
queryId
616
+
sql
617
+
}
618
+
}
619
+
```
620
+
621
+
:::info A note on querying saved queries
622
+
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.
623
+
:::
624
+
625
+
**Create query with saved queries**
626
+
627
+
This takes the same inputs as the `createQuery` mutation, but includes the field `savedQuery`. You can use this for frequently used queries.
0 commit comments