Skip to content

Commit

Permalink
Update metricflow-commands.md (#5290)
Browse files Browse the repository at this point in the history
adding clarifying loom on how to use cloud cli to query/preview metrics
as an extra help to the mf commands page.

context here:
https://dbt-labs.slack.com/archives/C03KHQRQUBX/p1713345879868029?thread_ts=1713280702.593279&cid=C03KHQRQUBX
  • Loading branch information
mirnawong1 authored Apr 18, 2024
2 parents ac40ee5 + cb1488b commit c1e0759
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions website/docs/docs/build/metricflow-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ You can use the `dbt sl` prefix before the command name to execute them in the d
- [`tutorial`](#tutorial) — Dedicated MetricFlow tutorial to help get you started.
-->

<expandable alt_header="How can I query or preview metrics with the dbt Cloud CLI?">

Check out the following video for a short video demo of how to query or preview metrics with the dbt Cloud CLI:

<LoomVideo id='09e2b287f063497d888f4bed91469d79' />

</expandable>

</TabItem>

<TabItem value="core" label="Commands for dbt Core">
Expand Down Expand Up @@ -564,12 +572,13 @@ mf query --metrics revenue --group-by metric_time__month # In dbt Core
## FAQs
<details>
<summary>How can I add a dimension filter to a where filter?</summary>
<detailsToggle alt_header="How can I add a dimension filter to a where filter?">
To add a dimension filter to a where filter, you have to indicate that the filter item is part of your model and use a template wrapper: `{{Dimension('primary_entity__dimension_name')}}`.
To add a dimension filter to a where filter, you have to indicate that the filter item is part of your model and use a template wrapper: <code>{{Dimension('primary_entity__dimension_name')}}</code>.
Here's an example query: `dbt sl query --metrics order_total --group-by metric_time --where "{{Dimension('order_id__is_food_order')}} = True"`.
Here's an example query: <code>dbt sl query --metrics order_total --group-by metric_time --where "{{Dimension('order_id__is_food_order')}} = True"</code>.<br /><br /> Before using the template wrapper, however, set up your terminal to escape curly braces for the filter template to work.
Before using the template wrapper, however, set up your terminal to escape curly braces for the filter template to work.
<details>
<summary>How to set up your terminal to escape curly braces? </summary>
Expand Down Expand Up @@ -598,13 +607,14 @@ source ~/.zshrc
Keep in mind that modifying your shell configuration files can have an impact on how your shell behaves. If you're not familiar with shell configuration, it's a good idea to make a backup of your <code>.zshrc</code> file before making any changes. If you encounter any issues or unexpected behavior, you can revert to the backup.
</details>
</details>
</detailsToggle>
<details>
<summary>Why is my query limited to 100 rows in the dbt Cloud CLI?</summary>
The default <code>limit</code> for query issues from the dbt Cloud CLI is 100 rows. We set this default to prevent returning unnecessarily large data sets as the dbt Cloud CLI is typically used to query the dbt Semantic Layer during the development process, not for production reporting or to access large data sets. For most workflows, you only need to return a subset of the data.<br /><br />
However, you can change this limit if needed by setting the <code>--limit</code> option in your query. For example, to return 1000 rows, you can run <code>dbt sl list metrics --limit 1000</code>.
</details>
<detailsToggle alt_header="Why is my query limited to 100 rows in the dbt Cloud CLI?">
The default `limit` for query issues from the dbt Cloud CLI is 100 rows. We set this default to prevent returning unnecessarily large data sets as the dbt Cloud CLI is typically used to query the dbt Semantic Layer during the development process, not for production reporting or to access large data sets. For most workflows, you only need to return a subset of the data.
However, you can change this limit if needed by setting the `--limit` option in your query. For example, to return 1000 rows, you can run `dbt sl list metrics --limit 1000`.
</detailsToggle>

0 comments on commit c1e0759

Please sign in to comment.