Merged PR 2105: Adding listing lifecycle metrics into business KPIs

This PR will compute the listing metrics in an aggregated manner to be displayed in the Main KPIs dashboard, specifically:
- New Listings
- First Time Booked Listings
- Churning Listings
- It also adapts the computation for the already existing metrics of Listings Booked in X months

At code level, it contains the following:
- Adds `int_core__mtd_accommodation_metrics`, which computes the aggregation of the lifecycle of listings at date level (unique), being date the corresponding date from `int_dates_mtd`
- Changes `int_core__mtd_aggregated_metrics` to take the accommodation metrics from the new model. Those 3 already existing (Listings booked in X month) now read from the new model as well.
- Changes `int_core__mtd_booking_metrics` to remove unused computation, making it lighter. Specifically, it removes 1) listing related metrics, since now we have a dedicated model and 2) number of guests booked, since it's not used at all.

The resulting values in local are consistent with what is already reported in the staging report.

Related work items: #17312
This commit is contained in:
Oriol Roqué Paniagua 2024-06-25 08:14:23 +00:00
parent f23e210129
commit 0655ac8997
4 changed files with 157 additions and 91 deletions

View file

@ -144,6 +144,11 @@ models:
- unique
- name: int_core__mtd_booking_metrics
description: |
This model contains the historic information regarding the bookings in an aggregated manner.
It's used for the business KPIs. Data is aggregated at the last day of the month and in the
days necessary for the Month-to-Date computation of the current month.
columns:
- name: date
data_type: date
@ -152,6 +157,20 @@ models:
- not_null
- unique
- name: int_core__mtd_accommodation_metrics
description: |
This model contains the historic information regarding the accommodations in an aggregated manner.
It's used for the business KPIs. Data is aggregated at the last day of the month and in the
days necessary for the Month-to-Date computation of the current month.
columns:
- name: date
data_type: date
description: The date for the month-to-date accommodation-related metrics.
tests:
- not_null
- unique
- name: int_core__mtd_aggregated_metrics
description: |
The `int_core__mtd_aggregated_metrics` model aggregates multiple metrics on a year, month, and day basis.