From 392006b71cdd19725e9ed933d8436faaf3104dbf Mon Sep 17 00:00:00 2001 From: Joaquin Date: Mon, 4 Nov 2024 16:51:24 +0100 Subject: [PATCH 1/6] CSAT score --- ...hly_check_in_attributed_guest_journeys.sql | 4 +- ...mtd_check_in_attributed_guest_journeys.sql | 4 +- ...ily_check_in_attributed_guest_journeys.sql | 19 +++- ...hly_check_in_attributed_guest_journeys.sql | 4 +- ...mtd_check_in_attributed_guest_journeys.sql | 4 +- models/intermediate/kpis/schema.yml | 97 ++++++++++++++++++- 6 files changed, 126 insertions(+), 6 deletions(-) diff --git a/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql index 8f0ef70..768f71b 100644 --- a/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql @@ -26,7 +26,9 @@ ) as completed_guest_journeys_not_cancelled, sum(created_guest_journeys) as created_guest_journeys, sum(started_guest_journeys) as started_guest_journeys, - sum(completed_guest_journeys) as completed_guest_journeys + sum(completed_guest_journeys) as completed_guest_journeys, + sum(count_csat_score) as count_csat_score, + sum(count_csat_score * average_csat_score)/sum(count_csat_score) as average_csat_score from {{ ref("int_kpis__metric_monthly_check_in_attributed_guest_journeys") }} group by 1, 2, 3, 4 {% if not loop.last %} diff --git a/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql index 6544f1c..5c87b29 100644 --- a/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql @@ -26,7 +26,9 @@ ) as completed_guest_journeys_not_cancelled, sum(created_guest_journeys) as created_guest_journeys, sum(started_guest_journeys) as started_guest_journeys, - sum(completed_guest_journeys) as completed_guest_journeys + sum(completed_guest_journeys) as completed_guest_journeys, + sum(count_csat_score) as count_csat_score, + sum(count_csat_score * average_csat_score)/sum(count_csat_score) as average_csat_score from {{ ref("int_kpis__metric_mtd_check_in_attributed_guest_journeys") }} group by 1, 2, 3, 4 {% if not loop.last %} diff --git a/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql index ebbf068..ae4d365 100644 --- a/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql @@ -69,7 +69,21 @@ select then vr.id_verification_request else null end - ) as completed_guest_journeys + ) as completed_guest_journeys, + count( + distinct case + when gsr.id_verification_request is not null + then vr.id_verification_request + else null + end + ) as count_csat_score, + avg( + distinct case + when gsr.id_verification_request is not null + then gsr.experience_rating + else null + end + ) as average_csat_score from {{ ref("int_core__verification_requests") }} as vr inner join {{ ref("int_core__bookings") }} as b @@ -88,4 +102,7 @@ left join {{ ref("stg_core__verification") }} as v on v.id_verification_request = vr.id_verification_request and v.verification = '{{ id_check }}' +left join + {{ ref("int_core__guest_satisfaction_responses") }} as gsr + on gsr.id_verification_request = vr.id_verification_request group by 1, 2, 3, 4, 5, 6 diff --git a/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql index 021092a..bd70d0e 100644 --- a/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql @@ -23,7 +23,9 @@ select ) as completed_guest_journeys_not_cancelled, sum(b.created_guest_journeys) as created_guest_journeys, sum(b.started_guest_journeys) as started_guest_journeys, - sum(b.completed_guest_journeys) as completed_guest_journeys + sum(b.completed_guest_journeys) as completed_guest_journeys, + sum(b.count_csat_score) as count_csat_score, + sum(b.count_csat_score * b.average_csat_score)/sum(b.count_csat_score) as average_csat_score from {{ ref("int_kpis__dimension_dates") }} d left join {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} b diff --git a/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql index 4c7a5f2..a692631 100644 --- a/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql @@ -23,7 +23,9 @@ select ) as completed_guest_journeys_not_cancelled, sum(b.created_guest_journeys) as created_guest_journeys, sum(b.started_guest_journeys) as started_guest_journeys, - sum(b.completed_guest_journeys) as completed_guest_journeys + sum(b.completed_guest_journeys) as completed_guest_journeys, + sum(b.count_csat_score) as count_csat_score, + sum(b.count_csat_score * b.average_csat_score)/sum(b.count_csat_score) as average_csat_score from {{ ref("int_kpis__dimension_dates") }} d left join {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} b diff --git a/models/intermediate/kpis/schema.yml b/models/intermediate/kpis/schema.yml index 95e6099..eddc71d 100644 --- a/models/intermediate/kpis/schema.yml +++ b/models/intermediate/kpis/schema.yml @@ -3189,6 +3189,17 @@ models: description: | Count of daily guest journeys completed in a given date and per specified dimension. + + - name: count_csat_score + data_type: bigint + description: | + Count of daily guest journeys with CSAT (customer satisfaction score) + in a given date and per specified dimension. + + - name: average_csat_score + data_type: bigint + description: | + Average daily CSAT score in a given date and per specified dimension. - name: int_kpis__metric_monthly_check_in_attributed_guest_journeys description: | @@ -3324,6 +3335,26 @@ models: tests: - not_null + - name: count_csat_score + data_type: numeric + description: | + Count of daily guest journeys with CSAT (customer satisfaction score) + in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false + + - name: average_csat_score + data_type: numeric + description: | + Average daily CSAT score in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: 5 + strictly: false + - name: int_kpis__agg_monthly_check_in_attributed_guest_journeys description: | This model computes the dimension aggregation for Monthly metrics associated @@ -3368,6 +3399,8 @@ models: metric_column_name: started_guest_journeys - assert_dimension_completeness: metric_column_name: completed_guest_journeys + - assert_dimension_completeness: + metric_column_name: count_csat_score - accepted_values: values: - global @@ -3432,6 +3465,26 @@ models: tests: - not_null + - name: count_csat_score + data_type: numeric + description: | + Count of daily guest journeys with CSAT (customer satisfaction score) + in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false + + - name: average_csat_score + data_type: numeric + description: | + Average daily CSAT score in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: 5 + strictly: false + - name: int_kpis__metric_mtd_check_in_attributed_guest_journeys description: | This model computes the Month-To-Date metrics associated with Guest Journeys @@ -3566,6 +3619,26 @@ models: tests: - not_null + - name: count_csat_score + data_type: numeric + description: | + Count of daily guest journeys with CSAT (customer satisfaction score) + in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false + + - name: average_csat_score + data_type: numeric + description: | + Average daily CSAT score in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: 5 + strictly: false + - name: int_kpis__agg_mtd_check_in_attributed_guest_journeys description: | This model computes the dimension aggregation for Month-To-Date metrics associated @@ -3610,6 +3683,8 @@ models: metric_column_name: started_guest_journeys - assert_dimension_completeness: metric_column_name: completed_guest_journeys + - assert_dimension_completeness: + metric_column_name: count_csat_score - accepted_values: values: - global @@ -3672,4 +3747,24 @@ models: Monthly aggregated count of guest journeys completed for a given date, dimension, and value. tests: - - not_null \ No newline at end of file + - not_null + + - name: count_csat_score + data_type: numeric + description: | + Count of daily guest journeys with CSAT (customer satisfaction score) + in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false + + - name: average_csat_score + data_type: numeric + description: | + Average daily CSAT score in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: 5 + strictly: false \ No newline at end of file From 5d642d2c773ab71913aeae0e50e145285be6c159 Mon Sep 17 00:00:00 2001 From: Joaquin Date: Mon, 4 Nov 2024 18:15:13 +0100 Subject: [PATCH 2/6] Addressed comments --- ...hly_check_in_attributed_guest_journeys.sql | 2 +- ...mtd_check_in_attributed_guest_journeys.sql | 2 +- ...ily_check_in_attributed_guest_journeys.sql | 2 +- ...hly_check_in_attributed_guest_journeys.sql | 2 +- ...mtd_check_in_attributed_guest_journeys.sql | 2 +- models/intermediate/kpis/schema.yml | 90 ++++++++----------- 6 files changed, 43 insertions(+), 57 deletions(-) diff --git a/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql index 768f71b..02d6fe6 100644 --- a/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql @@ -28,7 +28,7 @@ sum(started_guest_journeys) as started_guest_journeys, sum(completed_guest_journeys) as completed_guest_journeys, sum(count_csat_score) as count_csat_score, - sum(count_csat_score * average_csat_score)/sum(count_csat_score) as average_csat_score + sum(count_csat_score * average_csat_score) / nullif(sum(count_csat_score), 0) as average_csat_score from {{ ref("int_kpis__metric_monthly_check_in_attributed_guest_journeys") }} group by 1, 2, 3, 4 {% if not loop.last %} diff --git a/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql index 5c87b29..27a9b7e 100644 --- a/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql @@ -28,7 +28,7 @@ sum(started_guest_journeys) as started_guest_journeys, sum(completed_guest_journeys) as completed_guest_journeys, sum(count_csat_score) as count_csat_score, - sum(count_csat_score * average_csat_score)/sum(count_csat_score) as average_csat_score + sum(count_csat_score * average_csat_score) / nullif(sum(count_csat_score), 0) as average_csat_score from {{ ref("int_kpis__metric_mtd_check_in_attributed_guest_journeys") }} group by 1, 2, 3, 4 {% if not loop.last %} diff --git a/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql index ae4d365..8317ed7 100644 --- a/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql @@ -78,7 +78,7 @@ select end ) as count_csat_score, avg( - distinct case + case when gsr.id_verification_request is not null then gsr.experience_rating else null diff --git a/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql index bd70d0e..41c37db 100644 --- a/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql @@ -25,7 +25,7 @@ select sum(b.started_guest_journeys) as started_guest_journeys, sum(b.completed_guest_journeys) as completed_guest_journeys, sum(b.count_csat_score) as count_csat_score, - sum(b.count_csat_score * b.average_csat_score)/sum(b.count_csat_score) as average_csat_score + sum(b.count_csat_score * b.average_csat_score) / nullif(sum(b.count_csat_score), 0) as average_csat_score from {{ ref("int_kpis__dimension_dates") }} d left join {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} b diff --git a/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql index a692631..b93cab7 100644 --- a/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql @@ -25,7 +25,7 @@ select sum(b.started_guest_journeys) as started_guest_journeys, sum(b.completed_guest_journeys) as completed_guest_journeys, sum(b.count_csat_score) as count_csat_score, - sum(b.count_csat_score * b.average_csat_score)/sum(b.count_csat_score) as average_csat_score + sum(b.count_csat_score * b.average_csat_score) / nullif(sum(b.count_csat_score), 0) as average_csat_score from {{ ref("int_kpis__dimension_dates") }} d left join {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} b diff --git a/models/intermediate/kpis/schema.yml b/models/intermediate/kpis/schema.yml index eddc71d..4e7bdd5 100644 --- a/models/intermediate/kpis/schema.yml +++ b/models/intermediate/kpis/schema.yml @@ -3290,31 +3290,31 @@ models: - name: created_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys created, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys created, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: started_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys started, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys started, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: completed_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys completed, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys completed, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: created_guest_journeys data_type: numeric description: | - Count of daily guest journeys created in a given date and + Accumulated count of daily guest journeys created in a given date and per specified dimension. tests: - not_null @@ -3322,7 +3322,7 @@ models: - name: started_guest_journeys data_type: numeric description: | - Count of daily guest journeys started in a given date and + Accumulated count of daily guest journeys started in a given date and per specified dimension. tests: - not_null @@ -3330,7 +3330,7 @@ models: - name: completed_guest_journeys data_type: numeric description: | - Count of daily guest journeys completed in a given date and + Accumulated count of daily guest journeys completed in a given date and per specified dimension. tests: - not_null @@ -3338,17 +3338,13 @@ models: - name: count_csat_score data_type: numeric description: | - Count of daily guest journeys with CSAT (customer satisfaction score) - in a given date and per specified dimension. - tests: - - dbt_expectations.expect_column_values_to_be_between: - min_value: 0 - strictly: false + Accumulated count of guest journeys with CSAT + (customer satisfaction score) in a given date, dimension, and value.. - name: average_csat_score data_type: numeric description: | - Average daily CSAT score in a given date and per specified dimension. + Accumulated average CSAT score in a given date, dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 @@ -3468,17 +3464,14 @@ models: - name: count_csat_score data_type: numeric description: | - Count of daily guest journeys with CSAT (customer satisfaction score) - in a given date and per specified dimension. - tests: - - dbt_expectations.expect_column_values_to_be_between: - min_value: 0 - strictly: false + Monthly aggregated count of guest journeys with CSAT + (customer satisfaction score) in a given date, dimension, and value. - name: average_csat_score data_type: numeric description: | - Average daily CSAT score in a given date and per specified dimension. + Monthly aggregated average CSAT score in a given date, + dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 @@ -3574,31 +3567,31 @@ models: - name: created_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys created, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys created, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: started_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys started, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys started, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: completed_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys completed, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys completed, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: created_guest_journeys data_type: numeric description: | - Count of daily guest journeys created in a given date and + Accumulated count of daily guest journeys created in a given date and per specified dimension. tests: - not_null @@ -3606,7 +3599,7 @@ models: - name: started_guest_journeys data_type: numeric description: | - Count of daily guest journeys started in a given date and + Accumulated count of daily guest journeys started in a given date and per specified dimension. tests: - not_null @@ -3614,7 +3607,7 @@ models: - name: completed_guest_journeys data_type: numeric description: | - Count of daily guest journeys completed in a given date and + Accumulated count of daily guest journeys completed in a given date and per specified dimension. tests: - not_null @@ -3622,17 +3615,13 @@ models: - name: count_csat_score data_type: numeric description: | - Count of daily guest journeys with CSAT (customer satisfaction score) - in a given date and per specified dimension. - tests: - - dbt_expectations.expect_column_values_to_be_between: - min_value: 0 - strictly: false + Accumulated count of guest journeys with CSAT + (customer satisfaction score) in a given date, dimension, and value.. - name: average_csat_score data_type: numeric description: | - Average daily CSAT score in a given date and per specified dimension. + Accumulated average CSAT score in a given date, dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 @@ -3704,7 +3693,7 @@ models: - name: created_guest_journeys_not_cancelled data_type: numeric description: | - Monthly aggregated count of guest journeys created, excluding + Month-to-date aggregated count of guest journeys created, excluding cancelled bookings, for a given date, dimension, and value. tests: - not_null @@ -3712,7 +3701,7 @@ models: - name: started_guest_journeys_not_cancelled data_type: numeric description: | - Monthly aggregated count of guest journeys started, excluding + Month-to-date aggregated count of guest journeys started, excluding cancelled bookings, for a given date, dimension, and value. tests: - not_null @@ -3720,7 +3709,7 @@ models: - name: completed_guest_journeys_not_cancelled data_type: numeric description: | - Monthly aggregated count of guest journeys completed, excluding + Month-to-date aggregated count of guest journeys completed, excluding cancelled bookings, for a given date, dimension, and value. tests: - not_null @@ -3728,7 +3717,7 @@ models: - name: created_guest_journeys data_type: numeric description: | - Monthly aggregated count of guest journeys created for a given date, + Month-to-date aggregated count of guest journeys created for a given date, dimension, and value. tests: - not_null @@ -3736,7 +3725,7 @@ models: - name: started_guest_journeys data_type: numeric description: | - Monthly aggregated count of guest journeys started for a given date, + Month-to-date aggregated count of guest journeys started for a given date, dimension, and value. tests: - not_null @@ -3744,7 +3733,7 @@ models: - name: completed_guest_journeys data_type: numeric description: | - Monthly aggregated count of guest journeys completed for a given date, + Month-to-date aggregated count of guest journeys completed for a given date, dimension, and value. tests: - not_null @@ -3752,17 +3741,14 @@ models: - name: count_csat_score data_type: numeric description: | - Count of daily guest journeys with CSAT (customer satisfaction score) - in a given date and per specified dimension. - tests: - - dbt_expectations.expect_column_values_to_be_between: - min_value: 0 - strictly: false + Month-to-date aggregated count of guest journeys with CSAT + (customer satisfaction score) in a given date, dimension, and value. - name: average_csat_score data_type: numeric description: | - Average daily CSAT score in a given date and per specified dimension. + Month-to-date aggregated average CSAT score in a given date, + dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 From 84b7f2569ce8f8afac599a58f329fe3620296910 Mon Sep 17 00:00:00 2001 From: Joaquin Date: Tue, 5 Nov 2024 10:24:17 +0100 Subject: [PATCH 3/6] final changes --- models/intermediate/kpis/schema.yml | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/models/intermediate/kpis/schema.yml b/models/intermediate/kpis/schema.yml index 4e7bdd5..de87f8f 100644 --- a/models/intermediate/kpis/schema.yml +++ b/models/intermediate/kpis/schema.yml @@ -3290,7 +3290,7 @@ models: - name: created_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys created, excluding cancelled + Monthly accumulated count of daily guest journeys created, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3298,7 +3298,7 @@ models: - name: started_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys started, excluding cancelled + Monthly accumulated count of daily guest journeys started, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3306,7 +3306,7 @@ models: - name: completed_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys completed, excluding cancelled + Monthly accumulated count of daily guest journeys completed, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3314,7 +3314,7 @@ models: - name: created_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys created in a given date and + Monthly accumulated count of daily guest journeys created in a given date and per specified dimension. tests: - not_null @@ -3322,7 +3322,7 @@ models: - name: started_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys started in a given date and + Monthly accumulated count of daily guest journeys started in a given date and per specified dimension. tests: - not_null @@ -3330,7 +3330,7 @@ models: - name: completed_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys completed in a given date and + Monthly accumulated count of daily guest journeys completed in a given date and per specified dimension. tests: - not_null @@ -3338,13 +3338,13 @@ models: - name: count_csat_score data_type: numeric description: | - Accumulated count of guest journeys with CSAT - (customer satisfaction score) in a given date, dimension, and value.. + Monthly accumulated count of guest journeys with CSAT + (customer satisfaction score) in a given date, dimension, and value. - name: average_csat_score data_type: numeric description: | - Accumulated average CSAT score in a given date, dimension, and value. + Monthly accumulated average CSAT score in a given date, dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 @@ -3567,7 +3567,7 @@ models: - name: created_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys created, excluding cancelled + Month-to-date accumulated count of daily guest journeys created, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3575,7 +3575,7 @@ models: - name: started_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys started, excluding cancelled + Month-to-date accumulated count of daily guest journeys started, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3583,7 +3583,7 @@ models: - name: completed_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys completed, excluding cancelled + Month-to-date accumulated count of daily guest journeys completed, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3591,7 +3591,7 @@ models: - name: created_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys created in a given date and + Month-to-date accumulated count of daily guest journeys created in a given date and per specified dimension. tests: - not_null @@ -3599,7 +3599,7 @@ models: - name: started_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys started in a given date and + Month-to-date accumulated count of daily guest journeys started in a given date and per specified dimension. tests: - not_null @@ -3607,7 +3607,7 @@ models: - name: completed_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys completed in a given date and + Month-to-date accumulated count of daily guest journeys completed in a given date and per specified dimension. tests: - not_null @@ -3615,13 +3615,13 @@ models: - name: count_csat_score data_type: numeric description: | - Accumulated count of guest journeys with CSAT + Month-to-date accumulated count of guest journeys with CSAT (customer satisfaction score) in a given date, dimension, and value.. - name: average_csat_score data_type: numeric description: | - Accumulated average CSAT score in a given date, dimension, and value. + Month-to-date accumulated average CSAT score in a given date, dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 From ee2cb2e40e526d5f791a1365878642536679016b Mon Sep 17 00:00:00 2001 From: Joaquin Date: Mon, 4 Nov 2024 16:51:24 +0100 Subject: [PATCH 4/6] CSAT score --- ...hly_check_in_attributed_guest_journeys.sql | 4 +- ...mtd_check_in_attributed_guest_journeys.sql | 4 +- ...ily_check_in_attributed_guest_journeys.sql | 19 +++- ...hly_check_in_attributed_guest_journeys.sql | 4 +- ...mtd_check_in_attributed_guest_journeys.sql | 4 +- models/intermediate/kpis/schema.yml | 95 +++++++++++++++++++ 6 files changed, 125 insertions(+), 5 deletions(-) diff --git a/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql index 8f0ef70..768f71b 100644 --- a/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql @@ -26,7 +26,9 @@ ) as completed_guest_journeys_not_cancelled, sum(created_guest_journeys) as created_guest_journeys, sum(started_guest_journeys) as started_guest_journeys, - sum(completed_guest_journeys) as completed_guest_journeys + sum(completed_guest_journeys) as completed_guest_journeys, + sum(count_csat_score) as count_csat_score, + sum(count_csat_score * average_csat_score)/sum(count_csat_score) as average_csat_score from {{ ref("int_kpis__metric_monthly_check_in_attributed_guest_journeys") }} group by 1, 2, 3, 4 {% if not loop.last %} diff --git a/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql index 6544f1c..5c87b29 100644 --- a/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql @@ -26,7 +26,9 @@ ) as completed_guest_journeys_not_cancelled, sum(created_guest_journeys) as created_guest_journeys, sum(started_guest_journeys) as started_guest_journeys, - sum(completed_guest_journeys) as completed_guest_journeys + sum(completed_guest_journeys) as completed_guest_journeys, + sum(count_csat_score) as count_csat_score, + sum(count_csat_score * average_csat_score)/sum(count_csat_score) as average_csat_score from {{ ref("int_kpis__metric_mtd_check_in_attributed_guest_journeys") }} group by 1, 2, 3, 4 {% if not loop.last %} diff --git a/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql index ebbf068..ae4d365 100644 --- a/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql @@ -69,7 +69,21 @@ select then vr.id_verification_request else null end - ) as completed_guest_journeys + ) as completed_guest_journeys, + count( + distinct case + when gsr.id_verification_request is not null + then vr.id_verification_request + else null + end + ) as count_csat_score, + avg( + distinct case + when gsr.id_verification_request is not null + then gsr.experience_rating + else null + end + ) as average_csat_score from {{ ref("int_core__verification_requests") }} as vr inner join {{ ref("int_core__bookings") }} as b @@ -88,4 +102,7 @@ left join {{ ref("stg_core__verification") }} as v on v.id_verification_request = vr.id_verification_request and v.verification = '{{ id_check }}' +left join + {{ ref("int_core__guest_satisfaction_responses") }} as gsr + on gsr.id_verification_request = vr.id_verification_request group by 1, 2, 3, 4, 5, 6 diff --git a/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql index 021092a..bd70d0e 100644 --- a/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql @@ -23,7 +23,9 @@ select ) as completed_guest_journeys_not_cancelled, sum(b.created_guest_journeys) as created_guest_journeys, sum(b.started_guest_journeys) as started_guest_journeys, - sum(b.completed_guest_journeys) as completed_guest_journeys + sum(b.completed_guest_journeys) as completed_guest_journeys, + sum(b.count_csat_score) as count_csat_score, + sum(b.count_csat_score * b.average_csat_score)/sum(b.count_csat_score) as average_csat_score from {{ ref("int_kpis__dimension_dates") }} d left join {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} b diff --git a/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql index 4c7a5f2..a692631 100644 --- a/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql @@ -23,7 +23,9 @@ select ) as completed_guest_journeys_not_cancelled, sum(b.created_guest_journeys) as created_guest_journeys, sum(b.started_guest_journeys) as started_guest_journeys, - sum(b.completed_guest_journeys) as completed_guest_journeys + sum(b.completed_guest_journeys) as completed_guest_journeys, + sum(b.count_csat_score) as count_csat_score, + sum(b.count_csat_score * b.average_csat_score)/sum(b.count_csat_score) as average_csat_score from {{ ref("int_kpis__dimension_dates") }} d left join {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} b diff --git a/models/intermediate/kpis/schema.yml b/models/intermediate/kpis/schema.yml index f768f6f..493b00c 100644 --- a/models/intermediate/kpis/schema.yml +++ b/models/intermediate/kpis/schema.yml @@ -3190,6 +3190,17 @@ models: Count of daily guest journeys completed in a given date and per specified dimension. + - name: count_csat_score + data_type: bigint + description: | + Count of daily guest journeys with CSAT (customer satisfaction score) + in a given date and per specified dimension. + + - name: average_csat_score + data_type: bigint + description: | + Average daily CSAT score in a given date and per specified dimension. + - name: int_kpis__metric_monthly_check_in_attributed_guest_journeys description: | This model computes the Monthly metrics associated with Guest Journeys @@ -3324,6 +3335,26 @@ models: tests: - not_null + - name: count_csat_score + data_type: numeric + description: | + Count of daily guest journeys with CSAT (customer satisfaction score) + in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false + + - name: average_csat_score + data_type: numeric + description: | + Average daily CSAT score in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: 5 + strictly: false + - name: int_kpis__agg_monthly_check_in_attributed_guest_journeys description: | This model computes the dimension aggregation for Monthly metrics associated @@ -3368,6 +3399,8 @@ models: metric_column_name: started_guest_journeys - assert_dimension_completeness: metric_column_name: completed_guest_journeys + - assert_dimension_completeness: + metric_column_name: count_csat_score - accepted_values: values: - global @@ -3432,6 +3465,26 @@ models: tests: - not_null + - name: count_csat_score + data_type: numeric + description: | + Count of daily guest journeys with CSAT (customer satisfaction score) + in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false + + - name: average_csat_score + data_type: numeric + description: | + Average daily CSAT score in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: 5 + strictly: false + - name: int_kpis__metric_mtd_check_in_attributed_guest_journeys description: | This model computes the Month-To-Date metrics associated with Guest Journeys @@ -3566,6 +3619,26 @@ models: tests: - not_null + - name: count_csat_score + data_type: numeric + description: | + Count of daily guest journeys with CSAT (customer satisfaction score) + in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false + + - name: average_csat_score + data_type: numeric + description: | + Average daily CSAT score in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: 5 + strictly: false + - name: int_kpis__agg_mtd_check_in_attributed_guest_journeys description: | This model computes the dimension aggregation for Month-To-Date metrics associated @@ -3610,6 +3683,8 @@ models: metric_column_name: started_guest_journeys - assert_dimension_completeness: metric_column_name: completed_guest_journeys + - assert_dimension_completeness: + metric_column_name: count_csat_score - accepted_values: values: - global @@ -3673,6 +3748,26 @@ models: dimension, and value. tests: - not_null + + - name: count_csat_score + data_type: numeric + description: | + Count of daily guest journeys with CSAT (customer satisfaction score) + in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false + + - name: average_csat_score + data_type: numeric + description: | + Average daily CSAT score in a given date and per specified dimension. + tests: + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: 5 + strictly: false - name: int_kpis__metric_daily_host_resolutions description: | From eb8e59f8c583da2b5586ce354696073374eaee64 Mon Sep 17 00:00:00 2001 From: Joaquin Date: Mon, 4 Nov 2024 18:15:13 +0100 Subject: [PATCH 5/6] Addressed comments --- ...hly_check_in_attributed_guest_journeys.sql | 2 +- ...mtd_check_in_attributed_guest_journeys.sql | 2 +- ...ily_check_in_attributed_guest_journeys.sql | 2 +- ...hly_check_in_attributed_guest_journeys.sql | 2 +- ...mtd_check_in_attributed_guest_journeys.sql | 2 +- models/intermediate/kpis/schema.yml | 90 ++++++++----------- 6 files changed, 43 insertions(+), 57 deletions(-) diff --git a/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql index 768f71b..02d6fe6 100644 --- a/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__agg_monthly_check_in_attributed_guest_journeys.sql @@ -28,7 +28,7 @@ sum(started_guest_journeys) as started_guest_journeys, sum(completed_guest_journeys) as completed_guest_journeys, sum(count_csat_score) as count_csat_score, - sum(count_csat_score * average_csat_score)/sum(count_csat_score) as average_csat_score + sum(count_csat_score * average_csat_score) / nullif(sum(count_csat_score), 0) as average_csat_score from {{ ref("int_kpis__metric_monthly_check_in_attributed_guest_journeys") }} group by 1, 2, 3, 4 {% if not loop.last %} diff --git a/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql index 5c87b29..27a9b7e 100644 --- a/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__agg_mtd_check_in_attributed_guest_journeys.sql @@ -28,7 +28,7 @@ sum(started_guest_journeys) as started_guest_journeys, sum(completed_guest_journeys) as completed_guest_journeys, sum(count_csat_score) as count_csat_score, - sum(count_csat_score * average_csat_score)/sum(count_csat_score) as average_csat_score + sum(count_csat_score * average_csat_score) / nullif(sum(count_csat_score), 0) as average_csat_score from {{ ref("int_kpis__metric_mtd_check_in_attributed_guest_journeys") }} group by 1, 2, 3, 4 {% if not loop.last %} diff --git a/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql index ae4d365..8317ed7 100644 --- a/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_daily_check_in_attributed_guest_journeys.sql @@ -78,7 +78,7 @@ select end ) as count_csat_score, avg( - distinct case + case when gsr.id_verification_request is not null then gsr.experience_rating else null diff --git a/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql index bd70d0e..41c37db 100644 --- a/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_monthly_check_in_attributed_guest_journeys.sql @@ -25,7 +25,7 @@ select sum(b.started_guest_journeys) as started_guest_journeys, sum(b.completed_guest_journeys) as completed_guest_journeys, sum(b.count_csat_score) as count_csat_score, - sum(b.count_csat_score * b.average_csat_score)/sum(b.count_csat_score) as average_csat_score + sum(b.count_csat_score * b.average_csat_score) / nullif(sum(b.count_csat_score), 0) as average_csat_score from {{ ref("int_kpis__dimension_dates") }} d left join {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} b diff --git a/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql b/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql index a692631..b93cab7 100644 --- a/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql +++ b/models/intermediate/kpis/int_kpis__metric_mtd_check_in_attributed_guest_journeys.sql @@ -25,7 +25,7 @@ select sum(b.started_guest_journeys) as started_guest_journeys, sum(b.completed_guest_journeys) as completed_guest_journeys, sum(b.count_csat_score) as count_csat_score, - sum(b.count_csat_score * b.average_csat_score)/sum(b.count_csat_score) as average_csat_score + sum(b.count_csat_score * b.average_csat_score) / nullif(sum(b.count_csat_score), 0) as average_csat_score from {{ ref("int_kpis__dimension_dates") }} d left join {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} b diff --git a/models/intermediate/kpis/schema.yml b/models/intermediate/kpis/schema.yml index 493b00c..0d627e3 100644 --- a/models/intermediate/kpis/schema.yml +++ b/models/intermediate/kpis/schema.yml @@ -3290,31 +3290,31 @@ models: - name: created_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys created, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys created, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: started_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys started, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys started, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: completed_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys completed, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys completed, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: created_guest_journeys data_type: numeric description: | - Count of daily guest journeys created in a given date and + Accumulated count of daily guest journeys created in a given date and per specified dimension. tests: - not_null @@ -3322,7 +3322,7 @@ models: - name: started_guest_journeys data_type: numeric description: | - Count of daily guest journeys started in a given date and + Accumulated count of daily guest journeys started in a given date and per specified dimension. tests: - not_null @@ -3330,7 +3330,7 @@ models: - name: completed_guest_journeys data_type: numeric description: | - Count of daily guest journeys completed in a given date and + Accumulated count of daily guest journeys completed in a given date and per specified dimension. tests: - not_null @@ -3338,17 +3338,13 @@ models: - name: count_csat_score data_type: numeric description: | - Count of daily guest journeys with CSAT (customer satisfaction score) - in a given date and per specified dimension. - tests: - - dbt_expectations.expect_column_values_to_be_between: - min_value: 0 - strictly: false + Accumulated count of guest journeys with CSAT + (customer satisfaction score) in a given date, dimension, and value.. - name: average_csat_score data_type: numeric description: | - Average daily CSAT score in a given date and per specified dimension. + Accumulated average CSAT score in a given date, dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 @@ -3468,17 +3464,14 @@ models: - name: count_csat_score data_type: numeric description: | - Count of daily guest journeys with CSAT (customer satisfaction score) - in a given date and per specified dimension. - tests: - - dbt_expectations.expect_column_values_to_be_between: - min_value: 0 - strictly: false + Monthly aggregated count of guest journeys with CSAT + (customer satisfaction score) in a given date, dimension, and value. - name: average_csat_score data_type: numeric description: | - Average daily CSAT score in a given date and per specified dimension. + Monthly aggregated average CSAT score in a given date, + dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 @@ -3574,31 +3567,31 @@ models: - name: created_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys created, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys created, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: started_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys started, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys started, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: completed_guest_journeys_not_cancelled data_type: numeric description: | - Count of daily guest journeys completed, excluding cancelled bookings, - in a given date and per specified dimension. + Accumulated count of daily guest journeys completed, excluding cancelled + bookings, in a given date and per specified dimension. tests: - not_null - name: created_guest_journeys data_type: numeric description: | - Count of daily guest journeys created in a given date and + Accumulated count of daily guest journeys created in a given date and per specified dimension. tests: - not_null @@ -3606,7 +3599,7 @@ models: - name: started_guest_journeys data_type: numeric description: | - Count of daily guest journeys started in a given date and + Accumulated count of daily guest journeys started in a given date and per specified dimension. tests: - not_null @@ -3614,7 +3607,7 @@ models: - name: completed_guest_journeys data_type: numeric description: | - Count of daily guest journeys completed in a given date and + Accumulated count of daily guest journeys completed in a given date and per specified dimension. tests: - not_null @@ -3622,17 +3615,13 @@ models: - name: count_csat_score data_type: numeric description: | - Count of daily guest journeys with CSAT (customer satisfaction score) - in a given date and per specified dimension. - tests: - - dbt_expectations.expect_column_values_to_be_between: - min_value: 0 - strictly: false + Accumulated count of guest journeys with CSAT + (customer satisfaction score) in a given date, dimension, and value.. - name: average_csat_score data_type: numeric description: | - Average daily CSAT score in a given date and per specified dimension. + Accumulated average CSAT score in a given date, dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 @@ -3704,7 +3693,7 @@ models: - name: created_guest_journeys_not_cancelled data_type: numeric description: | - Monthly aggregated count of guest journeys created, excluding + Month-to-date aggregated count of guest journeys created, excluding cancelled bookings, for a given date, dimension, and value. tests: - not_null @@ -3712,7 +3701,7 @@ models: - name: started_guest_journeys_not_cancelled data_type: numeric description: | - Monthly aggregated count of guest journeys started, excluding + Month-to-date aggregated count of guest journeys started, excluding cancelled bookings, for a given date, dimension, and value. tests: - not_null @@ -3720,7 +3709,7 @@ models: - name: completed_guest_journeys_not_cancelled data_type: numeric description: | - Monthly aggregated count of guest journeys completed, excluding + Month-to-date aggregated count of guest journeys completed, excluding cancelled bookings, for a given date, dimension, and value. tests: - not_null @@ -3728,7 +3717,7 @@ models: - name: created_guest_journeys data_type: numeric description: | - Monthly aggregated count of guest journeys created for a given date, + Month-to-date aggregated count of guest journeys created for a given date, dimension, and value. tests: - not_null @@ -3736,7 +3725,7 @@ models: - name: started_guest_journeys data_type: numeric description: | - Monthly aggregated count of guest journeys started for a given date, + Month-to-date aggregated count of guest journeys started for a given date, dimension, and value. tests: - not_null @@ -3744,7 +3733,7 @@ models: - name: completed_guest_journeys data_type: numeric description: | - Monthly aggregated count of guest journeys completed for a given date, + Month-to-date aggregated count of guest journeys completed for a given date, dimension, and value. tests: - not_null @@ -3752,17 +3741,14 @@ models: - name: count_csat_score data_type: numeric description: | - Count of daily guest journeys with CSAT (customer satisfaction score) - in a given date and per specified dimension. - tests: - - dbt_expectations.expect_column_values_to_be_between: - min_value: 0 - strictly: false + Month-to-date aggregated count of guest journeys with CSAT + (customer satisfaction score) in a given date, dimension, and value. - name: average_csat_score data_type: numeric description: | - Average daily CSAT score in a given date and per specified dimension. + Month-to-date aggregated average CSAT score in a given date, + dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 From 25936324114d290e6a0908320227045bd73dd964 Mon Sep 17 00:00:00 2001 From: Joaquin Date: Tue, 5 Nov 2024 10:24:17 +0100 Subject: [PATCH 6/6] final changes --- models/intermediate/kpis/schema.yml | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/models/intermediate/kpis/schema.yml b/models/intermediate/kpis/schema.yml index 0d627e3..6bbcb57 100644 --- a/models/intermediate/kpis/schema.yml +++ b/models/intermediate/kpis/schema.yml @@ -3290,7 +3290,7 @@ models: - name: created_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys created, excluding cancelled + Monthly accumulated count of daily guest journeys created, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3298,7 +3298,7 @@ models: - name: started_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys started, excluding cancelled + Monthly accumulated count of daily guest journeys started, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3306,7 +3306,7 @@ models: - name: completed_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys completed, excluding cancelled + Monthly accumulated count of daily guest journeys completed, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3314,7 +3314,7 @@ models: - name: created_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys created in a given date and + Monthly accumulated count of daily guest journeys created in a given date and per specified dimension. tests: - not_null @@ -3322,7 +3322,7 @@ models: - name: started_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys started in a given date and + Monthly accumulated count of daily guest journeys started in a given date and per specified dimension. tests: - not_null @@ -3330,7 +3330,7 @@ models: - name: completed_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys completed in a given date and + Monthly accumulated count of daily guest journeys completed in a given date and per specified dimension. tests: - not_null @@ -3338,13 +3338,13 @@ models: - name: count_csat_score data_type: numeric description: | - Accumulated count of guest journeys with CSAT - (customer satisfaction score) in a given date, dimension, and value.. + Monthly accumulated count of guest journeys with CSAT + (customer satisfaction score) in a given date, dimension, and value. - name: average_csat_score data_type: numeric description: | - Accumulated average CSAT score in a given date, dimension, and value. + Monthly accumulated average CSAT score in a given date, dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0 @@ -3567,7 +3567,7 @@ models: - name: created_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys created, excluding cancelled + Month-to-date accumulated count of daily guest journeys created, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3575,7 +3575,7 @@ models: - name: started_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys started, excluding cancelled + Month-to-date accumulated count of daily guest journeys started, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3583,7 +3583,7 @@ models: - name: completed_guest_journeys_not_cancelled data_type: numeric description: | - Accumulated count of daily guest journeys completed, excluding cancelled + Month-to-date accumulated count of daily guest journeys completed, excluding cancelled bookings, in a given date and per specified dimension. tests: - not_null @@ -3591,7 +3591,7 @@ models: - name: created_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys created in a given date and + Month-to-date accumulated count of daily guest journeys created in a given date and per specified dimension. tests: - not_null @@ -3599,7 +3599,7 @@ models: - name: started_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys started in a given date and + Month-to-date accumulated count of daily guest journeys started in a given date and per specified dimension. tests: - not_null @@ -3607,7 +3607,7 @@ models: - name: completed_guest_journeys data_type: numeric description: | - Accumulated count of daily guest journeys completed in a given date and + Month-to-date accumulated count of daily guest journeys completed in a given date and per specified dimension. tests: - not_null @@ -3615,13 +3615,13 @@ models: - name: count_csat_score data_type: numeric description: | - Accumulated count of guest journeys with CSAT + Month-to-date accumulated count of guest journeys with CSAT (customer satisfaction score) in a given date, dimension, and value.. - name: average_csat_score data_type: numeric description: | - Accumulated average CSAT score in a given date, dimension, and value. + Month-to-date accumulated average CSAT score in a given date, dimension, and value. tests: - dbt_expectations.expect_column_values_to_be_between: min_value: 0