Commit graph

339 commits

Author SHA1 Message Date
Joaquin Ossa
205bc6534d Modified date name to stick to convention 2024-07-04 08:24:23 +02:00
Joaquin Ossa
6bc26a66ff Changed date name to check_in_cover_added_date and included model in reporting 2024-07-03 17:43:27 +02:00
Joaquin Ossa
3ce81dfdd1 Fixed the filter for check-in cover verification set and changed named to adopted 2024-07-03 16:16:58 +02:00
Joaquin Ossa
fedf808b6b Added date of adaptation 2024-07-03 15:05:12 +02:00
Oriol Roqué Paniagua
ed5d7828a7 Merged PR 2179: Computes aggregated metrics by deal id and exposes it to reporting
This PR creates 2 new models:
- `int_core__monthly_aggregated_metrics_history_by_deal`, which just gathers the information of the previously created models that compute the kpis by deal id.
- `core__monthly_aggregated_metrics_history_by_deal`, effectively a copy from intermediate to reporting

It also includes documentation of these 2 models, differences between these and the `mtd_aggregated_metrics` equivalents and references it to exposures. I took the opportunity to update the documentation of the `core__mtd_aggregated_metrics` now that it's a bit more mature.

This should be the last PR for the first draft of 'by deal' metrics.

Related work items: #17689
2024-07-03 07:06:34 +00:00
Oriol Roqué Paniagua
f9741d6f69 Merged PR 2172: Adding accommodation metrics by deal id
Adding accommodation metrics by deal id with the model `int_core__monthly_accommodation_history_by_deal`.

With this PR, we have the full set of batch 1 metrics by deal id completed, although separated in different tables. Aggregation will come in a separated PR.

Similarly as the previous PR, this one it's a mix between the logic of `int_core__mtd_accommodation_metrics` and the logic existing for the `int_core__monthly_X_history_by_deal` . It also adds the tests in schema.

Related work items: #17689
2024-07-02 09:32:52 +00:00
Oriol Roqué Paniagua
1a4b6b4c14 Merged PR 2171: Adding Guest Journey metrics by deal id
Adding the 6 Guest Journey metrics by deal id by creating the model `int_core__monthly_guest_journey_history_by_deal`

The structure for the deal id detail follows yesterday's approach on bookings, namely `int_core__monthly_booking_history_by_deal`, but considering the metric computation of the guest journey, namely `int_core__mtd_guest_journey_metrics`.

It also adds the dbt tests ensuring that date and id_deal are not null and that the combination of both is unique.

Related work items: #17689
2024-07-02 07:26:20 +00:00
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
Pablo Martin
64377da570 PK test 2024-07-01 16:54:58 +02:00
Pablo Martin
83f67a06bf model 2024-07-01 16:53:54 +02:00
Pablo Martin
2f133c1424 add source 2024-07-01 16:50:12 +02:00
Pablo Martín
915b9d5165 Merged PR 2161: Sign for bank transactions
The bank transactions table coming from Xero has positive amounts for all transactions by default.

Nevertheless, some transactions are receiving and some are sending.

This PR implements sign for transactions amounts throughout the DWH so that aggregations work properly.

I've also left the transaction sign column in some spots since it might be useful for some aggregation wizardry (ie cancel out receiving transactions in resolutions so that counts are more accurate).

Related work items: #17551
2024-07-01 12:02:25 +00:00
Pablo Martin
883618add1 subquery to CTE 2024-07-01 14:02:13 +02:00
Pablo Martin
487f6701e3 apply transaction sign in line items 2024-07-01 11:45:03 +02:00
Pablo Martin
dd5882a564 propagate transaction sign 2024-07-01 11:44:55 +02:00
Pablo Martin
0e9c608894 more docs 2024-07-01 11:39:40 +02:00
Pablo Martin
1b942b7506 add col 2024-07-01 11:39:36 +02:00
Pablo Martin
f0f6382bbd update docs 2024-07-01 11:34:26 +02:00
Pablo Martin
e963ba274d implement transaction sign 2024-07-01 11:27:18 +02:00
Joaquin Ossa
256c638b04 Added id_deal to both intermediate and report model 2024-07-01 10:48:00 +02:00
Oriol Roqué Paniagua
a3b1decb08 Merged PR 2158: Allow last day of the month to appear on 1st of month
As today it's 1st of July, the logic of selecting all days of the current month for MTD purposes on the business KPIs is ko, since we select up to yesterday.
This PR allows to consider the last day of the previous month as 'current month' only for the first day of the following month, thus ensuring that the most up-to-date data is always displayed in the MTD tab.

Related work items: #17745
2024-07-01 07:53:38 +00:00
Joaquin Ossa
50f93a2980 Created check_in_cover_users in reporting for check-in hero report 2024-06-27 12:24:45 +02:00
Joaquin Ossa
cab300f7dd Addressed comments 2024-06-27 12:13:27 +02:00
Joaquin Ossa
a4b16e7410 Completed the schema for the model 2024-06-27 10:40:44 +02:00
Joaquin Ossa
9950c4d9ae Fixed merge error 2024-06-27 10:18:29 +02:00
Joaquin Ossa
04de0c8227 Changed name of model 2024-06-27 10:13:18 +02:00
Joaquin Ossa
431182a098 Removed accommodations from the model 2024-06-27 10:11:48 +02:00
Joaquin Ossa
2a897c6ead fixed model name and dump tables 2024-06-27 10:07:47 +02:00
Joaquin Ossa
cbd1b4414f Created int model for host accommodations with check in hero 2024-06-27 10:07:47 +02:00
Pablo Martín
5cc248de9c Merged PR 2124: Denormalized Bank Transactions Mart
A very denormalized table that brings Bank Transactions Line Items, Bank Transactions and Contacts into a single table.

Building this because we need to show some data in a PBI report that needs data from all three tables and can't be joined in PBI.

Related work items: #17551
2024-06-26 14:47:18 +00:00
Oriol Roqué Paniagua
5c12dd3b13 Merged PR 2125: Fixing accommodation host
Fixing accommodation host by using accommodation to user, after discussion with Ben R.
This improves data quality, even though there's some duplicates removal.
I checked and it effectively removes accommodations that mostly were considered as 'Never Booked', thus not a massive impact is expected for the business kpis. But in any case, let's do things properly :)

Related work items: #17538
2024-06-26 14:47:15 +00:00
Pablo Martin
69ad42af63 model and schema 2024-06-26 15:35:44 +02:00
Pablo Martin
b3263e82b1 docs typos 2024-06-26 13:40:07 +02:00
Pablo Martin
e8f9432507 add docs and tablesfor table 2024-06-26 11:43:29 +02:00
Pablo Martin
a22d85340d reporting model 2024-06-26 11:24:34 +02:00
Pablo Martin
bb17b7a646 put back accidentally removed column that breaks dbt run 2024-06-25 17:20:36 +02:00
Pablo Martin
5182a804b2 fix typos 2024-06-25 17:09:02 +02:00
Pablo Martin
be24725b7d remove a couple of wrong tests 2024-06-25 16:44:19 +02:00
Pablo Martin
f9fcb76ed1 schemas 2024-06-25 16:42:40 +02:00
Pablo Martin
86ca7411af remove line items: they have their own tables now 2024-06-25 16:41:41 +02:00
Pablo Martin
5fbf5a76fd add documentation placeholder 2024-06-25 16:25:26 +02:00
Pablo Martin
71278abbb9 remove outdated docs 2024-06-25 16:25:26 +02:00
Pablo Martin
8b1d949f73 add bank transactions to reporting 2024-06-25 16:25:26 +02:00
Pablo Martin
88e13182a5 convert currency after subtracting in local currency 2024-06-25 16:24:39 +02:00
Pablo Martin
3973f0a4a6 rename field 2024-06-25 15:07:39 +02:00
Pablo Martin
854afffc1c add account code 2024-06-25 15:07:39 +02:00
Pablo Martin
8dc31f3489 add accounts to staging 2024-06-25 15:07:39 +02:00
Pablo Martin
7a9c913b8a line items 2024-06-25 15:07:39 +02:00
Pablo Martin
d86b6b8627 add tests 2024-06-25 15:07:39 +02:00
Pablo Martin
33d072015c remove full jsons with ids 2024-06-25 15:07:39 +02:00