Remove old models

This commit is contained in:
Joaquin 2025-05-05 14:47:22 +02:00
parent 6970901196
commit a265b01672
4 changed files with 0 additions and 739 deletions

View file

@ -1,194 +0,0 @@
with
int_monthly_aggregated_metrics_history_by_deal as (
select * from {{ ref("int_monthly_aggregated_metrics_history_by_deal") }}
)
select
year as year,
month as month,
day as day,
date as date,
id_deal as id_deal,
client_type as client_type,
business_scope as business_scope,
main_deal_name as main_deal_name,
main_billing_country_iso_3_per_deal as main_billing_country_iso_3_per_deal,
deal_lifecycle_state as deal_lifecycle_state,
created_bookings as created_bookings,
cancelled_created_bookings as cancelled_created_bookings,
not_cancelled_created_bookings as not_cancelled_created_bookings,
cancelled_created_bookings_rate as cancelled_created_bookings_rate,
check_out_bookings as check_out_bookings,
cancelled_check_out_bookings as cancelled_check_out_bookings,
not_cancelled_check_out_bookings as not_cancelled_check_out_bookings,
billable_check_out_bookings as billable_check_out_bookings,
cancelled_check_out_bookings_rate as cancelled_check_out_bookings_rate,
billable_bookings as billable_bookings,
created_guest_journeys as created_guest_journeys,
started_guest_journeys as started_guest_journeys,
completed_guest_journeys as completed_guest_journeys,
paid_guest_journeys as paid_guest_journeys,
start_rate_guest_journey as start_rate_guest_journey,
completion_rate_guest_journey as completion_rate_guest_journey,
incompletion_rate_guest_journey as incompletion_rate_guest_journey,
payment_rate_guest_journey as payment_rate_guest_journey,
new_listings as new_listings,
first_time_booked_listings as first_time_booked_listings,
churning_listings as churning_listings,
listings_booked_in_month as listings_booked_in_month,
listings_booked_in_6_months as listings_booked_in_6_months,
listings_booked_in_12_months as listings_booked_in_12_months,
-- Avoid displaying revenue figures until invoicing period finishes
case
when {{ is_date_before_20th_of_previous_month("date") }}
then total_revenue_in_gbp
else null
end as total_revenue_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then total_revenue_per_created_booking
else null
end as total_revenue_per_created_booking,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then total_revenue_per_created_guest_journey
else null
end as total_revenue_per_created_guest_journey,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then total_revenue_per_listings_booked_in_month
else null
end as total_revenue_per_listings_booked_in_month,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_operator_net_fees_in_gbp
else null
end as xero_operator_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_apis_net_fees_in_gbp
else null
end as xero_apis_net_fees_in_gbp,
total_guest_payments_in_gbp as total_guest_revenue_in_gbp,
guest_payments_per_completed_guest_journey
as guest_revenue_per_completed_guest_journey,
guest_payments_per_paid_guest_journey as guest_revenue_per_paid_guest_journey,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_host_resolution_amount_paid_in_gbp
else null
end as xero_host_resolution_amount_paid_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_host_resolution_payment_count
else null
end as xero_host_resolution_payment_count,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then host_resolution_amount_paid_per_created_booking
else null
end as host_resolution_amount_paid_per_created_booking,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then host_resolution_payment_per_created_booking_ratio
else null
end as host_resolution_payment_per_created_booking_ratio,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_old_dashboard_booking_net_fees_in_gbp
else null
end as xero_old_dashboard_booking_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_booking_net_fees_in_gbp
else null
end as xero_booking_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_listing_net_fees_in_gbp
else null
end as xero_listing_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_verification_net_fees_in_gbp
else null
end as xero_verification_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_basic_protection_net_fees_in_gbp
else null
end as xero_basic_protection_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_waiver_pro_net_fees_in_gbp
else null
end as xero_waiver_pro_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_id_verification_net_fees_in_gbp
else null
end as xero_id_verification_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_protection_plus_net_fees_in_gbp
else null
end as xero_protection_plus_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_screening_plus_net_fees_in_gbp
else null
end as xero_screening_plus_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_sex_offenders_check_net_fees_in_gbp
else null
end as xero_sex_offenders_check_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_protection_pro_net_fees_in_gbp
else null
end as xero_protection_pro_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_guesty_net_fees_in_gbp
else null
end as xero_guesty_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_e_deposit_net_fees_in_gbp
else null
end as xero_e_deposit_net_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then xero_waiver_paid_back_to_host_in_gbp
else null
end as xero_waiver_paid_back_to_host_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then waiver_net_fees_in_gbp
else null
end as waiver_net_fees_in_gbp,
deposit_fees_in_gbp as deposit_fees_in_gbp,
waiver_payments_in_gbp as waiver_payments_in_gbp,
checkin_cover_fees_in_gbp as checkin_cover_fees_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then revenue_retained_in_gbp
else null
end as revenue_retained_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then revenue_retained_ratio
else null
end as revenue_retained_ratio,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then revenue_retained_post_resolutions_in_gbp
else null
end as revenue_retained_post_resolutions_in_gbp,
case
when {{ is_date_before_20th_of_previous_month("date") }}
then revenue_retained_post_resolutions_ratio
else null
end as revenue_retained_post_resolutions_ratio
from int_monthly_aggregated_metrics_history_by_deal

View file

@ -458,142 +458,6 @@ models:
positive impact for Truvi, otherwise is equal to relative_increment.
This value is specially created for formatting in PBI
- name: monthly_aggregated_metrics_history_by_deal
deprecation_date: 2025-04-28 08:00:00
description: |
This model aggregates the monthly historic information regarding the different metrics computed
at deal level. The primary source of data is the `int_monthly_XXXXX_history_by_deal`
model which contain the raw metrics data per source.
This table is used to provide "By Deal" metrics in the Business Overview reporting.
Unlike the mtd_aggregated_metrics, this model does not abstract each metric, since
no comparison versus last year is performed. In short, it just gathers the information stored
in the abovementioned models.
To keep in mind: aggregating the information of this model will not necessarily result into
the int_mtd_aggregated_metrics because 1) the mtd version contains more computing dates
than the by deal version, the latest being a subset of the first, and 2) the deal based model
enforces that a booking/guest journey/listing/etc has a host with a deal assigned, which is
not necessarily the case.
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date
- id_deal
columns:
- name: date
data_type: date
description: The last day of the month for historic metrics.
data_tests:
- not_null
- name: id_deal
data_type: character varying
description: Id of the deal associated to the host.
data_tests:
- not_null
- name: client_type
data_type: string
description: |
Type of client. It can be either PLATFORM or API.
data_tests:
- not_null
- accepted_values:
values:
- PLATFORM
- API
- name: business_scope
data_type: string
description: |
Business scope identifying the metric source.
data_tests:
- not_null
- accepted_values:
values:
- "Old Dash"
- "New Dash"
- "API"
- "UNSET"
- name: main_deal_name
data_type: string
description: |
Main name for this ID deal.
data_tests:
- not_null
- name: main_billing_country_iso_3_per_deal
data_type: string
description: |
ISO 3166-1 alpha-3 main country code in which the Deal is billed.
In some cases it's null.
- name: year
data_type: int
description: year number of the given date.
data_tests:
- not_null
- name: month
data_type: int
description: month number of the given date.
data_tests:
- not_null
- name: day
data_type: int
description: day monthly number of the given date.
data_tests:
- not_null
- name: host_resolution_amount_paid_per_created_booking
data_type: decimal
description: |
Host resolution amount paid divided by the number of
created bookings in the time window. It can be null if
no resolution payments were made by the host.
It can be negative or positive.
- name: host_resolution_payment_per_created_booking_ratio
data_type: decimal
description: |
Ratio of Host resolution payment count divided by the
number of created bookings in the time window. It can be null
if no resolution payments were made by the host.
It is capped between -1 and 1.
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
max_value: 1
strictly: false
- name: revenue_retained_ratio
data_type: decimal
description: |
Ratio of Revenue Retained divided by Total Revenue.
It is capped between -1 and 1. It can be Null
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
max_value: 1
strictly: false
- name: revenue_retained_post_resolutions_ratio
data_type: decimal
description: |
Ratio of Revenue Retained Post-Resolutions
divided by Total Revenue.
It is capped between -1 and 1. It can be Null
data_tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: -1
max_value: 1
strictly: false
- name: monthly_growth_score_by_deal
deprecation_date: 2025-05-10 08:00:00
description: |