aggregated guest kpis to reporting

This commit is contained in:
Joaquin Ossa 2024-11-26 16:43:56 +01:00
parent 0668c0beb4
commit 4360258ac9
2 changed files with 94 additions and 0 deletions

View file

@ -0,0 +1,15 @@
with
int_kpis__product_guest_agg_metrics as (
select * from {{ ref("int_kpis__product_guest_agg_metrics") }}
)
select
metric as metric,
has_payment as has_payment,
has_id_check as has_id_check,
main_billing_country_iso_3_per_deal as main_billing_country_iso_3_per_deal,
timeframe as timeframe,
current_value as current_value,
py_value as py_value,
pp_value as pp_value
from int_kpis__product_guest_agg_metrics

View file

@ -353,3 +353,82 @@ models:
granularity, date or dates range, dimension and value.
This metric is not additive, and its value can vary depending on the time
period considered.
- name: kpis__product_guest_agg_metrics
description:
This model aggregates multiple metrics on a Year-to-date, Month-to-date or
Week-to-date basis. This model changes the display format of the model
int_kpis__product_guest_daily_metrics pivoting the metrics columns and
adding a timeframe dimension.
columns:
- name: metric
data_type: text
description: Name of the business metric
- name: has_payment
data_type: string
description: Has there been any guest payments on the guest journey.
tests:
- not_null
- accepted_values:
values:
- W/O Payment
- With Payment
- name: has_id_check
data_type: string
description: Does the verification in the guest journey
includes Government Id Check for the bookings.
tests:
- not_null
- accepted_values:
values:
- W/O Id Check
- With Id Check
- name: main_billing_country_iso_3_per_deal
data_type: string
description: |
Main billing country of the host aggregated at Deal level.
tests:
- not_null
- name: timeframe
data_type: text
description: |
Timeframe considered for the aggregation, it could be Year-to-date,
Month-to-date or Week-to-date
tests:
- not_null
- accepted_values:
values:
- YTD
- MTD
- WTD
- name: current_value
data_type: numeric
description: |
Numeric value (integer or decimal) that corresponds to the timeframe
computation of the metric at the current date.
For example if the current date is 27/11/2024 and the timeframe is MTD,
then this value would correspond to the computation of the metric for
the dates between 01/11/2024 and 27/11/2024.
- name: py_value
data_type: numeric
description: |
Numeric value (integer or decimal) that corresponds to the timeframe
computation of the metric at the current date but on the previous year.
For example if the current date is 27/11/2024 and the timeframe is MTD,
then this value would correspond to the computation of the metric for
the dates between 01/11/2023 and 27/11/2023.
- name: pp_value
data_type: numeric
description: |
Numeric value (integer or decimal) that corresponds to the timeframe
computation of the metric at the current date but on the previous period.
For example if the current date is 27/11/2024 and the timeframe is MTD,
then this value would correspond to the computation of the metric for
the dates between 01/10/2024 and 27/10/2024.