Skip to content

Commit

Permalink
Remove create_metric parameter reference from 1.6 docs (#4468)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?
The create_metric parameter on measures defined in semantic models is
listed in the 1.6 documentation, but support for it was not added until
1.7.

This PR removes the create_metric entry from the 1.6 documentation.

<!---
Describe your changes and why you're making them. If linked to an open
issue or a pull request on dbt Core, then link to them here! 

To learn more about the writing conventions used in the dbt Labs docs,
see the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md).
-->

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
- [x] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."
  • Loading branch information
mirnawong1 authored Nov 17, 2023
2 parents f3e36e7 + d6a6cea commit 9bb059f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
18 changes: 6 additions & 12 deletions website/docs/docs/build/measures.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@ sidebar_label: "Measures"
tags: [Metrics, Semantic Layer]
---

Measures are aggregations performed on columns in your model. They can be used as final metrics or serve as building blocks for more complex metrics. Measures have several inputs, which are described in the following table along with their field types.

| Parameter | Description | Type |
| --------- | ----------- | ---- |
| [`name`](#name) | Provide a name for the measure, which must be unique and can't be repeated across all semantic models in your dbt project. | Required |
| [`description`](#description) | Describes the calculated measure. | Optional |
| [`agg`](#aggregation) | dbt supports aggregations such as `sum`, `min`, `max`, and more. Refer to [Aggregation](/docs/build/measures#aggregation) for the full list of supported aggregation types. | Required |
| [`expr`](#expr) | You can either reference an existing column in the table or use a SQL expression to create or derive a new one. | Optional |
| [`non_additive_dimension`](#non-additive-dimensions) | Non-additive dimensions can be specified for measures that cannot be aggregated over certain dimensions, such as bank account balances, to avoid producing incorrect results. | Optional |
| `agg_params` | specific aggregation properties such as a percentile. | Optional |
| `agg_time_dimension` | The time field. Defaults to the default agg time dimension for the semantic model. | Optional |
| `label` | How the metric appears in project docs and downstream integrations. | Required |
Measures are aggregations performed on columns in your model. They can be used as final metrics or serve as building blocks for more complex metrics.

Measures have several inputs, which are described in the following table along with their field types.

import MeasuresParameters from '/snippets/_sl-measures-parameters.md';

<MeasuresParameters />

## Measure spec

Expand Down
38 changes: 18 additions & 20 deletions website/docs/docs/build/semantic-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ The complete spec for semantic models is below:

```yaml
semantic_models:
- name: the_name_of_the_semantic_model ## Required
description: same as always ## Optional
model: ref('some_model') ## Required
defaults: ## Required
agg_time_dimension: dimension_name ## Required if the model contains dimensions
entities: ## Required
- see more information in entities
measures: ## Optional
- see more information in measures section
dimensions: ## Required
- see more information in dimensions section
- name: the_name_of_the_semantic_model ## Required
description: same as always ## Optional
model: ref('some_model') ## Required
default: ## Required
agg_time_dimension: dimension_name ## Required if the model contains dimensions
entities: ## Required
- see more information in entities
measures: ## Optional
- see more information in measures section
dimensions: ## Required
- see more information in dimensions section
primary_entity: >-
if the semantic model has no primary entity, then this property is required. #Optional if a primary entity exists, otherwise Required
```
Expand Down Expand Up @@ -230,16 +230,14 @@ For semantic models with a measure, you must have a [primary time group](/docs/b

### Measures

[Measures](/docs/build/measures) are aggregations applied to columns in your data model. They can be used as the foundational building blocks for more complex metrics, or be the final metric itself. Measures have various parameters which are listed in a table along with their descriptions and types.
[Measures](/docs/build/measures) are aggregations applied to columns in your data model. They can be used as the foundational building blocks for more complex metrics, or be the final metric itself.

Measures have various parameters which are listed in a table along with their descriptions and types.

import MeasuresParameters from '/snippets/_sl-measures-parameters.md';

<MeasuresParameters />

| Parameter | Description | Field type |
| --- | --- | --- |
| `name`| Provide a name for the measure, which must be unique and can't be repeated across all semantic models in your dbt project. | Required |
| `description` | Describes the calculated measure. | Optional |
| `agg` | dbt supports the following aggregations: `sum`, `max`, `min`, `count_distinct`, and `sum_boolean`. | Required |
| `expr` | You can either reference an existing column in the table or use a SQL expression to create or derive a new one. | Optional |
| `non_additive_dimension` | Non-additive dimensions can be specified for measures that cannot be aggregated over certain dimensions, such as bank account balances, to avoid producing incorrect results. | Optional |
| `create_metric` | You can create a metric directly from a measure with `create_metric: True` and specify its display name with create_metric_display_name. Default is false. | Optional |


import SetUpPages from '/snippets/_metrics-dependencies.md';
Expand Down
12 changes: 12 additions & 0 deletions website/snippets/_sl-measures-parameters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
| Parameter | Description |
| --- | --- | --- |
| [`name`](/docs/build/measures#name) | Provide a name for the measure, which must be unique and can't be repeated across all semantic models in your dbt project. | Required |
| [`description`](/docs/build/measures#description) | Describes the calculated measure. | Optional |
| [`agg`](/docs/build/measures#description) | dbt supports the following aggregations: `sum`, `max`, `min`, `count_distinct`, and `sum_boolean`. | Required |
| [`expr`](/docs/build/measures#expr) | Either reference an existing column in the table or use a SQL expression to create or derive a new one. | Optional |
| [`non_additive_dimension`](/docs/build/measures#non-additive-dimensions) | Non-additive dimensions can be specified for measures that cannot be aggregated over certain dimensions, such as bank account balances, to avoid producing incorrect results. | Optional |
| `agg_params` | Specific aggregation properties such as a percentile. | Optional |
| `agg_time_dimension` | The time field. Defaults to the default agg time dimension for the semantic model. | Optional | 1.6 and higher |
| `label`* | How the metric appears in project docs and downstream integrations. | Required |
| `create_metric`* | You can create a metric directly from a measure with `create_metric: True` and specify its display name with `create_metric_display_name`. | Optional |
*Available on dbt version 1.7 or higher.

0 comments on commit 9bb059f

Please sign in to comment.