Skip to content

Commit

Permalink
org tabs better
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 committed Jul 19, 2023
1 parent eab30e5 commit 6963cea
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions website/docs/docs/build/metricflow-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags: [Metrics, Semantic Layer]

Once you define metrics in your dbt project, you can query metrics, dimensions, dimension values, and validate your configs using the MetricFlow command line (CLI).

## Installation
# Installation

You can install the [MetricFlow CLI](https://github.com/dbt-labs/metricflow#getting-started) from [PyPI](https://pypi.org/project/dbt-metricflow/). You need to use `pip` to install the MetricFlow CLI on Windows or Linux operating systems:

Expand All @@ -17,7 +17,7 @@ You can install the [MetricFlow CLI](https://github.com/dbt-labs/metricflow#gett

The MetricFlow CLI is compatible with Python versions 3.8, 3.9, 3.10 and 3.11

## CLI commands
# CLI commands

The MetricFlow CLI provides the following commands to retrieve metadata and query metrics.

Expand All @@ -33,13 +33,13 @@ To execute the commands, use the `mf` prefix before the command name. For exampl
- [`tutorial`](#tutorial) — Dedicated MetricFlow tutorial to help get you started.
- [`query`](#query) — Query metrics and dimensions you want to see in the CLI. Refer to [query examples](#query-examples) to help you get started.

### List
## List

This command retrieves metadata values related to [Metrics](/docs/build/metrics-overview), [Dimensions](/docs/build/dimensions), and [Entities](/docs/build/entities) values.

For example, if you're trying to retrieve the `name` metadata value for a metric, you can use the following command:

### List metrics
## List metrics

This command lists the metrics with their available dimensions:

Expand All @@ -51,7 +51,7 @@ Options:
--help Show this message and exit.
```

### List dimensions
## List dimensions

This command lists all unique dimensions for a metric or multiple metrics. It displays only common dimensions when querying multiple metrics:

Expand All @@ -63,7 +63,7 @@ Options:
--help Show this message and exit.
```

### List dimension-values
## List dimension-values

This command lists all dimension values with the corresponding metric:

Expand All @@ -79,7 +79,7 @@ Options:
of the data (inclusive)
--help Show this message and exit.
```
### List entities
## List entities

This command lists all unique entities:

Expand Down Expand Up @@ -114,23 +114,23 @@ Options:
--help Show this message and exit.
```

### Health checks
## Health checks

This command performs a health check against the data platform you provided in the configs:

```bash
mf health-checks
```

### Tutorial
## Tutorial

Follow the dedicated MetricFlow tutorial to help you get started:

```bash
mf tutorial
```

### Query
## Query

Create a new query with MetricFlow, execute that query against the user's data platform, and return the result:

Expand Down Expand Up @@ -165,7 +165,7 @@ Options:
```


### Query examples
## Query examples

The following tabs presents various different types of query examples that you can use to query metrics and dimensions. Select the tab that best suits your needs:

Expand Down Expand Up @@ -220,6 +220,7 @@ mf query --metrics order_amount --group-by metric_time, is_food_order

</TabItem>


<TabItem value="eg3" label="Order/limit">

**Example 3** &mdash; You can add order and limit functions to filter and present the data in a readable format. The following query limits the data set to 10 records and orders them by `metric_time`, descending.
Expand Down Expand Up @@ -297,6 +298,17 @@ mf query --metrics order_amount --group-by metric_time,is_food_order --limit 10
</TabItem>


</Tabs>


### Additional query examples

The following tabs presents additional query examples, like exporting to a CSV. Select the tab that best suits your needs:

<Tabs>



<TabItem value="eg6" label="--explain flag">

**Example 6** &mdash; Add `--explain` to your query to view the SQL generated by MetricFlow.
Expand Down

0 comments on commit 6963cea

Please sign in to comment.