From 1737829899c05ea87dc333d6819e329ebcc48492 Mon Sep 17 00:00:00 2001 From: Akira Hayashi Date: Mon, 4 Mar 2024 07:21:53 +0900 Subject: [PATCH] Aggregate using `count_distinct` to resolve error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error got in `mf validate-configs`: > ✖ Breaking issues found when checking semantics of built manifest (ERRORS: 8, FUTURE_ERRORS: 0, WARNINGS: 0) > • ERROR: with metric `mql_to_seller_conversion_rate_1_week_window` - For conversion metrics, the measure must be COUNT/SUM(1)/COUNT_DISTINCT. Measure: mqls is agg type: AggregationType.SUM > • ERROR: with metric `mql_to_seller_conversion_rate_1_week_window` - For conversion metrics, the measure must be COUNT/SUM(1)/COUNT_DISTINCT. Measure: sellers is agg type: AggregationType.SUM > • ERROR: with metric `mql_to_seller_conversion_rate_7_day_window` - For conversion metrics, the measure must be COUNT/SUM(1)/COUNT_DISTINCT. Measure: mqls is agg type: AggregationType.SUM > • ERROR: with metric `mql_to_seller_conversion_rate_7_day_window` - For conversion metrics, the measure must be COUNT/SUM(1)/COUNT_DISTINCT. Measure: sellers is agg type: AggregationType.SUM > • ERROR: with metric `mql_to_seller_conversion_rate_7_day_window_with_filter` - For conversion metrics, the measure must be COUNT/SUM(1)/COUNT_DISTINCT. Measure: mqls is agg type: AggregationType.SUM > • ERROR: with metric `mql_to_seller_conversion_rate_7_day_window_with_filter` - For conversion metrics, the measure must be COUNT/SUM(1)/COUNT_DISTINCT. Measure: sellers is agg type: AggregationType.SUM > • ERROR: with metric `mql_to_seller_conversion_rate_base` - For conversion metrics, the measure must be COUNT/SUM(1)/COUNT_DISTINCT. Measure: mqls is agg type: AggregationType.SUM > • ERROR: with metric `mql_to_seller_conversion_rate_base` - For conversion metrics, the measure must be COUNT/SUM(1)/COUNT_DISTINCT. Measure: sellers is agg type: AggregationType.SUM --- models/marts/ecommerce/olist_closed_deals.yaml | 2 +- models/marts/ecommerce/olist_marketing_qualified_leads.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/marts/ecommerce/olist_closed_deals.yaml b/models/marts/ecommerce/olist_closed_deals.yaml index d761aaf..4fd0c5f 100644 --- a/models/marts/ecommerce/olist_closed_deals.yaml +++ b/models/marts/ecommerce/olist_closed_deals.yaml @@ -31,7 +31,7 @@ semantic_models: type: categorical measures: - name: sellers - agg: count + agg: count_distinct expr: seller_id create_metric: true metrics: diff --git a/models/marts/ecommerce/olist_marketing_qualified_leads.yaml b/models/marts/ecommerce/olist_marketing_qualified_leads.yaml index 4c51114..12c00e4 100644 --- a/models/marts/ecommerce/olist_marketing_qualified_leads.yaml +++ b/models/marts/ecommerce/olist_marketing_qualified_leads.yaml @@ -22,7 +22,7 @@ semantic_models: type: categorical measures: - name: mqls - agg: count + agg: count_distinct expr: mql_id metrics: - name: mqls