Skip to content

Commit

Permalink
Update cumulative-metrics.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Jul 19, 2023
1 parent 5bbfa6b commit cc7ea59
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions website/docs/docs/build/cumulative-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ tags: [Metrics, Semantic Layer]

Cumulative metrics aggregate a measure over a given window. If no window is specified, the window is considered infinite and accumulates values over all time.

:::info MetricFlow time spine required

You will need to create the [time spine model](/docs/build/metricflow-time-spine) before you add cumulative metrics.

:::

```yaml
# Cumulative metrics aggregate a measure over a given window. The window is considered infinite if no window parameter is passed (accumulate the measure over all time)
metrics:
Expand All @@ -24,7 +30,7 @@ metrics:
### Window options
This section details examples for when you specify and don't specify window options.
This section details examples of when you specify and don't specify window options.
<Tabs>
Expand Down Expand Up @@ -56,7 +62,7 @@ metrics:
window: 7 days
```

From the sample yaml above, note the following:
From the sample YAML above, note the following:

* `type`: Specify cumulative to indicate the type of metric.
* `type_params`: Specify the measure you want to aggregate as a cumulative metric. You have the option of specifying a `window`, or a `grain to date`.
Expand Down Expand Up @@ -142,7 +148,7 @@ metrics:
```yaml
metrics:
name: revenue_monthly_grain_to_date #For this metric, we use a monthly grain to date
description: Monthly revenue using a grain to date of 1 month (think of this as a monthly resetting point)
description: Monthly revenue using grain to date of 1 month (think of this as a monthly resetting point)
type: cumulative
type_params:
measures:
Expand Down

0 comments on commit cc7ea59

Please sign in to comment.