Skip to content

Commit

Permalink
add alias/filter fields to simple and converesion metrics (#6609)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Dec 10, 2024
2 parents 85aee67 + 765898e commit d38ca12
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion website/docs/docs/build/conversion-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Note that we use the double colon (::) to indicate whether a parameter is nested
| `base_measure:name` | The base conversion event measure. | Required | String |
| `base_measure:fill_nulls_with` | Set the value in your metric definition instead of null (such as zero). | Optional | String |
| `base_measure:join_to_timespine` | Boolean that indicates if the aggregated measure should be joined to the time spine table to fill in missing dates. Default `false`. | Optional | Boolean |
| `base_measure:filter` | Optional `filter` used to apply to the base measure. | Optional | String |
| `conversion_measure` | A list of conversion measure inputs. | Required | Dict |
| `conversion_measure:name` | The base conversion event measure.| Required | String |
| `conversion_measure:fill_nulls_with` | Set the value in your metric definition instead of null (such as zero). | Optional | String |
Expand Down Expand Up @@ -61,6 +62,7 @@ metrics:
name: The name of the measure # Required
fill_nulls_with: Set the value in your metric definition instead of null (such as zero) # Optional
join_to_timespine: true/false # Boolean that indicates if the aggregated measure should be joined to the time spine table to fill in missing dates. Default `false`. # Optional
filter: The filter used to apply to the base measure. # Optional
conversion_measure:
name: The name of the measure # Required
fill_nulls_with: Set the value in your metric definition instead of null (such as zero) # Optional
Expand Down Expand Up @@ -105,12 +107,13 @@ Next, define a conversion metric as follows:
- name: visit_to_buy_conversion_rate_7d
description: "Conversion rate from visiting to transaction in 7 days"
type: conversion
label: Visit to Buy Conversion Rate (7-day window)
label: Visit to buy conversion rate (7-day window)
type_params:
conversion_type_params:
base_measure:
name: visits
fill_nulls_with: 0
filter: {{ Dimension('visits__referrer_id') }} = 'facebook'
conversion_measure:
name: sellers
entity: user
Expand Down
8 changes: 7 additions & 1 deletion website/docs/docs/build/simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Note that we use the double colon (::) to indicate whether a parameter is nested
| `type_params` | The type parameters of the metric. | Required | Dict |
| `measure` | A list of measure inputs. | Required | List |
| `measure:name` | The measure you're referencing. | Required | String |
| `measure:alias` | Optional [`alias`](/reference/resource-configs/alias) to rename the measure. | Optional | String |
| `measure:filter` | Optional `filter` applied to the measure. | Optional | String |
| `measure:fill_nulls_with` | Set the value in your metric definition instead of null (such as zero). | Optional | String |
| `measure:join_to_timespine` | Indicates if the aggregated measure should be joined to the time spine table to fill in missing dates. Default `false`. | Optional | Boolean |

Expand All @@ -38,6 +40,8 @@ metrics:
type_params: # Required
measure:
name: The name of your measure # Required
alias: The alias applied to the measure. # Optional
filter: The filter applied to the measure. # Optional
fill_nulls_with: Set value instead of null (such as zero) # Optional
join_to_timespine: true/false # Boolean that indicates if the aggregated measure should be joined to the time spine table to fill in missing dates. # Optional

Expand Down Expand Up @@ -65,9 +69,11 @@ If you've already defined the measure using the `create_metric: true` parameter,
name: customers # The measure you are creating a proxy of.
fill_nulls_with: 0
join_to_timespine: true
alias: customer_count
filter: {{ Dimension('customer__customer_total') }} >= 20
- name: large_orders
description: "Order with order values over 20."
type: SIMPLE
type: simple
label: Large orders
type_params:
measure:
Expand Down

0 comments on commit d38ca12

Please sign in to comment.