data-dwh-dbt-project/models/intermediate/core
Oriol Roqué Paniagua 010135fb63 Merged PR 2164: Adding booking metrics by deal id for business kpis
This is a first approach to compute some easy metrics for the "deal" based business kpis. At this stage, it contains the information of bookings (created, checkout, cancelled) per deal and month, including both historic months as well as the current one. This do not contain MTD computation because it's overkill to do a MTD at deal level (+ we have 1k deals, so scalability can become a problem in the future)

Models:
- **int_dates_by_deal**: simple model that reads from **int_dates** and just joins it with **unified_users** to retrieve the deals. It will be used as the 'source of truth' for which deals should be considered in a given month, basically, since the first host associated to a deal is created (not necessarily booked)
- **int_core__monthly_booking_history_by_deal**: it contains the history of bookings per deal id in a monthly basis. It should be easy enough to integrate here, in the future and if needed, B2B macro segmentation.

In terms of performance, comparing the model **int_core__monthly_booking_history_by_deal** and **int_core__mtd_booking_metrics** you'll see that I removed the joined with the **int_dates_xxx** in the CTEs. This is because I want to avoid a double join of date & deal that I tried and I stopped after 5 min running. Since this computation is in a monthly basis - no MTD - it's easy enough to just apply the **int_dates_by_deal** on the last part of the query. With this approach, it runs in 7 seconds.

Related work items: #17689
2024-07-01 16:00:14 +00:00
..
int_core__accommodation.sql Merged PR 2125: Fixing accommodation host 2024-06-26 14:47:15 +00:00
int_core__booking_charge_events.sql Merged PR 2029: Guest Journey - start date based on used link 2024-06-13 14:53:58 +00:00
int_core__bookings.sql a few quick and dirty improvements 2024-05-10 00:31:27 +02:00
int_core__check_in_cover_prices.sql propagating renames 2024-05-08 12:03:44 +02:00
int_core__check_in_cover_users.sql Added id_deal to both intermediate and report model 2024-07-01 10:48:00 +02:00
int_core__country.sql Merged PR 2077: Adding Country to intermediate 2024-06-19 15:34:15 +00:00
int_core__deal_id_master_list.sql docs and moving stuff 2024-04-08 09:44:32 +02:00
int_core__duplicate_bookings.sql a few quick and dirty improvements 2024-05-10 00:31:27 +02:00
int_core__monthly_booking_history_by_deal.sql Merged PR 2164: Adding booking metrics by deal id for business kpis 2024-07-01 16:00:14 +00:00
int_core__mtd_accommodation_lifecycle.sql Merged PR 2125: Fixing accommodation host 2024-06-26 14:47:15 +00:00
int_core__mtd_accommodation_metrics.sql Merged PR 2107: Adds host lifecycle metrics into biz kpis 2024-06-25 12:20:59 +00:00
int_core__mtd_aggregated_metrics.sql Merged PR 2107: Adds host lifecycle metrics into biz kpis 2024-06-25 12:20:59 +00:00
int_core__mtd_booking_metrics.sql Merged PR 2164: Adding booking metrics by deal id for business kpis 2024-07-01 16:00:14 +00:00
int_core__mtd_deal_lifecycle.sql Merged PR 2107: Adds host lifecycle metrics into biz kpis 2024-06-25 12:20:59 +00:00
int_core__mtd_deal_metrics.sql Merged PR 2107: Adds host lifecycle metrics into biz kpis 2024-06-25 12:20:59 +00:00
int_core__mtd_guest_journey_metrics.sql Adding guest journey KPIs. Updating gitignore 2024-06-17 11:10:13 +02:00
int_core__price_plans.sql docs and moving stuff 2024-04-08 09:44:32 +02:00
int_core__unified_user.sql add phone number 2024-06-10 16:14:07 +02:00
int_core__unique_accommodation_to_user.sql Merged PR 2125: Fixing accommodation host 2024-06-26 14:47:15 +00:00
int_core__verification_payments.sql remove old table from cte 2024-06-18 11:31:59 +02:00
int_core__verification_request_completed_date.sql Merged PR 2028: guest journey estimated completed date 2024-06-13 13:30:22 +00:00
int_core__verification_request_completeness.sql Merged PR 2020: Verification request completeness for intermediate steps + schema documentation 2024-06-13 08:14:11 +00:00
int_core__verification_requests.sql Merged PR 2029: Guest Journey - start date based on used link 2024-06-13 14:53:58 +00:00
int_core__vr_check_in_cover.sql Merged PR 2029: Guest Journey - start date based on used link 2024-06-13 14:53:58 +00:00
schema.yaml Merged PR 2164: Adding booking metrics by deal id for business kpis 2024-07-01 16:00:14 +00:00