Addressed comments
This commit is contained in:
parent
21858d4d59
commit
64c3c6d1f0
8 changed files with 75 additions and 54 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{% set dimensions = get_kpi_dimensions_per_model("GUEST_JOURNEY_METRICS") %}
|
||||
{% set dimensions = get_kpi_dimensions_per_model("CHECK_IN_ATTRIBUTED_GUEST_JOURNEYS") %}
|
||||
|
||||
{{
|
||||
config(
|
||||
|
|
@ -27,9 +27,9 @@
|
|||
sum(created_guest_journeys) as created_guest_journeys,
|
||||
sum(started_guest_journeys) as started_guest_journeys,
|
||||
sum(completed_guest_journeys) as completed_guest_journeys
|
||||
from {{ ref("int_kpis__metric_mtd_check_in_attrib_guest_journeys") }}
|
||||
from {{ ref("int_kpis__metric_monthly_check_in_attributed_guest_journeys") }}
|
||||
group by 1, 2, 3, 4
|
||||
{% if not loop.last %}
|
||||
union all
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
|
@ -27,9 +27,9 @@
|
|||
sum(created_guest_journeys) as created_guest_journeys,
|
||||
sum(started_guest_journeys) as started_guest_journeys,
|
||||
sum(completed_guest_journeys) as completed_guest_journeys
|
||||
from {{ ref("int_kpis__metric_monthly_check_in_attrib_guest_journeys") }}
|
||||
from {{ ref("int_kpis__metric_mtd_check_in_attributed_guest_journeys") }}
|
||||
group by 1, 2, 3, 4
|
||||
{% if not loop.last %}
|
||||
union all
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{{
|
||||
config(
|
||||
materialized="view",
|
||||
unique_key=["end_date", "id_deal", "has_payment", "has_id_check"],
|
||||
unique_key=["end_date", "id_deal", "has_payment", "has_id_check", "active_accommodations_per_deal_segmentation"],
|
||||
)
|
||||
}}
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ select
|
|||
sum(b.completed_guest_journeys) as completed_guest_journeys
|
||||
from {{ ref("int_kpis__dimension_dates") }} d
|
||||
left join
|
||||
{{ ref("int_kpis__metric_daily_check_in_attrib_guest_journeys") }} b
|
||||
{{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} b
|
||||
on date_trunc('month', b.date)::date = d.first_day_month
|
||||
where d.is_end_of_month = true and b.id_deal is not null
|
||||
group by 1, 2, 3, 4, 5, 6, 7
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{{
|
||||
config(
|
||||
materialized="view",
|
||||
unique_key=["end_date", "id_deal", "has_payment", "has_id_check"],
|
||||
unique_key=["end_date", "id_deal", "has_payment", "has_id_check", "active_accommodations_per_deal_segmentation"],
|
||||
)
|
||||
}}
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ select
|
|||
sum(b.completed_guest_journeys) as completed_guest_journeys
|
||||
from {{ ref("int_kpis__dimension_dates") }} d
|
||||
left join
|
||||
{{ ref("int_kpis__metric_daily_check_in_attrib_guest_journeys") }} b
|
||||
{{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} b
|
||||
on date_trunc('month', b.date)::date = d.first_day_month
|
||||
and extract(day from b.date) <= d.day
|
||||
where d.is_month_to_date = true and b.id_deal is not null
|
||||
|
|
@ -480,8 +480,7 @@ models:
|
|||
description: The dimension or granularity of the metrics.
|
||||
tests:
|
||||
- assert_dimension_completeness:
|
||||
metric_column_names:
|
||||
- created_bookings
|
||||
metric_column_name: created_bookings
|
||||
- accepted_values:
|
||||
values:
|
||||
- global
|
||||
|
|
@ -3242,7 +3241,13 @@ models:
|
|||
tests:
|
||||
- not_null
|
||||
- accepted_values:
|
||||
values: ["0", "01-05", "06-20", "21-60", "61+", "UNSET"]
|
||||
values:
|
||||
- "0"
|
||||
- "01-05"
|
||||
- "06-20"
|
||||
- "21-60"
|
||||
- "61+"
|
||||
- "UNSET"
|
||||
|
||||
- name: main_billing_country_iso_3_per_deal
|
||||
data_type: character varying
|
||||
|
|
@ -3332,16 +3337,25 @@ models:
|
|||
The dimension or granularity of the metrics.
|
||||
tests:
|
||||
- assert_dimension_completeness:
|
||||
metric_column_names:
|
||||
- created_guest_journeys_not_cancelled
|
||||
- started_guest_journeys_not_cancelled
|
||||
- completed_guest_journeys_not_cancelled
|
||||
- created_guest_journeys
|
||||
- started_guest_journeys
|
||||
- completed_guest_journeys
|
||||
metric_column_name: created_guest_journeys_not_cancelled
|
||||
- assert_dimension_completeness:
|
||||
metric_column_name: started_guest_journeys_not_cancelled
|
||||
- assert_dimension_completeness:
|
||||
metric_column_name: completed_guest_journeys_not_cancelled
|
||||
- assert_dimension_completeness:
|
||||
metric_column_name: created_guest_journeys
|
||||
- assert_dimension_completeness:
|
||||
metric_column_name: started_guest_journeys
|
||||
- assert_dimension_completeness:
|
||||
metric_column_name: completed_guest_journeys
|
||||
- accepted_values:
|
||||
values: ["global", "by_deal", "by_has_payment", "by_has_id_check",
|
||||
"by_billing_country", "by_number_of_listings"]
|
||||
values:
|
||||
- global
|
||||
- by_deal
|
||||
- by_has_payment
|
||||
- by_has_id_check
|
||||
- by_billing_country
|
||||
- by_number_of_listings
|
||||
|
||||
- name: dimension_value
|
||||
data_type: text
|
||||
|
|
@ -3461,7 +3475,13 @@ models:
|
|||
tests:
|
||||
- not_null
|
||||
- accepted_values:
|
||||
values: ["0", "01-05", "06-20", "21-60", "61+", "UNSET"]
|
||||
values:
|
||||
- "0"
|
||||
- "01-05"
|
||||
- "06-20"
|
||||
- "21-60"
|
||||
- "61+"
|
||||
- "UNSET"
|
||||
|
||||
- name: main_billing_country_iso_3_per_deal
|
||||
data_type: character varying
|
||||
|
|
@ -3551,16 +3571,25 @@ models:
|
|||
The dimension or granularity of the metrics.
|
||||
tests:
|
||||
- assert_dimension_completeness:
|
||||
metric_column_names:
|
||||
- created_guest_journeys_not_cancelled
|
||||
- started_guest_journeys_not_cancelled
|
||||
- completed_guest_journeys_not_cancelled
|
||||
- created_guest_journeys
|
||||
- started_guest_journeys
|
||||
- completed_guest_journeys
|
||||
metric_column_name: created_guest_journeys_not_cancelled
|
||||
- assert_dimension_completeness:
|
||||
metric_column_name: started_guest_journeys_not_cancelled
|
||||
- assert_dimension_completeness:
|
||||
metric_column_name: completed_guest_journeys_not_cancelled
|
||||
- assert_dimension_completeness:
|
||||
metric_column_name: created_guest_journeys
|
||||
- assert_dimension_completeness:
|
||||
metric_column_name: started_guest_journeys
|
||||
- assert_dimension_completeness:
|
||||
metric_column_name: completed_guest_journeys
|
||||
- accepted_values:
|
||||
values: ["global", "by_deal", "by_has_payment", "by_has_id_check",
|
||||
"by_billing_country", "by_number_of_listings"]
|
||||
values:
|
||||
- global
|
||||
- by_deal
|
||||
- by_has_payment
|
||||
- by_has_id_check
|
||||
- by_billing_country
|
||||
- by_number_of_listings
|
||||
|
||||
- name: dimension_value
|
||||
data_type: text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue