Commit graph

16 commits

Author SHA1 Message Date
Oriol Roqué Paniagua
f23e210129 Merged PR 2094: Removing lifecycle logic from int_core__accommodation
Removing lifecycle logic from int_core__accommodation
This logic is now available on int_core__mtd_accommodation_lifecycle

Related work items: #17312
2024-06-21 14:13:42 +00:00
Oriol Roqué Paniagua
ef80637a9b Merged PR 2090: Adding int_core__mtd_accommodation_lifecycle
Adding int_core__mtd_accommodation_lifecycle. Mainly, it recreates the history of the lifecycle of a listing for each date appearing in the MTD dates (so, last day of month + days for current month + days for current month of the previous year).

Implementation of lag function makes it much faster than self-join. Runs in approx 17 seconds (in local)

The logic behind the lifecycle is the same, and the most-up-to-date results in my local show the same values for the new model and the int_core__accommodation model (see screenshots)

previous model:
![image.png](https://guardhog.visualstudio.com/4148d95f-4b6d-4205-bcff-e9c8e0d2ca65/_apis/git/repositories/54ac356f-aad7-46d2-b62c-e8c5b3bb8ebf/pullRequests/2090/attachments/image.png)

new model:
![image (2).png](https://guardhog.visualstudio.com/4148d95f-4b6d-4205-bcff-e9c8e0d2ca65/_apis/git/repositories/54ac356f-aad7-46d2-b62c-e8c5b3bb8ebf/pullRequests/2090/attachments/image%20%282%29.png)

Following PRs will focus on readapting logic of int_core__accommodation to avoid the replication of lifecycle computation (just re-use the last available date in int_core__mtd_accommodation_lifecycle) and the creation of the desired metrics for the Biz Overview dashboard, including a refactor of the mtd_bookings to remove the listing logic from there.

Related work items: #17312
2024-06-21 13:59:14 +00:00
Oriol Roqué Paniagua
fe93f594f5 Merged PR 2084: Adding int_core__accommodation
Adding int_core__accommodation

Includes both:
- Main information of the accommodation, mostly coming from stg_core__accommodation and int_core__country.
- Listing lifecycle computation, based on the created bookings from stg_core__bookings. It's just the current state, no history.

Some considerations:
- I opted to use stg_core__bookings and not int_core__bookings. Main reason is in case at some point we want to add listing-based information to the booking table, it would avoid cyclic references.
- I opted to keep all the logic of 1) accommodation info and 2) lifecycle in the same model. This could be easily split into: lifecycle first that reads uniquely from staging and then the int_core__accommodation that could read from the staging version to retrieve accommodation attributes + the lifecycle one. Up to you

I'd suggest to review first the documentation in schema since it explains the logic applied.

Notion page linked to this task: https://www.notion.so/knowyourguest-superhog/Listing-lifecycle-4dc0311b21ca44f8859969e419872ebd

Related work items: #17312
2024-06-20 16:02:16 +00:00
Oriol Roqué Paniagua
839e5fae1b Merged PR 2077: Adding Country to intermediate
Adding Country to intermediate, both model + documentation.

At this stage, the model is set as a view but we can discuss what is the best approach

Related work items: #17312
2024-06-19 15:34:15 +00:00
Pablo Martin
344419e660 formatting 2024-06-18 13:41:32 +02:00
Pablo Martin
3d3f3fb9ab fix docs 2024-06-18 13:40:36 +02:00
Pablo Martin
27759374b8 add docs and tests 2024-06-18 13:10:47 +02:00
Oriol Roqué Paniagua
4958976733 Merged PR 2053: Added number_format category in mtd_aggregated_metrics
Added number_format category in mtd_aggregated_metrics

Related work items: #17458
2024-06-17 14:59:01 +00:00
uri
cc930c5202 Extra documentation in the int_core__mtd_aggregated_metrics model 2024-06-17 11:32:13 +02:00
Oriol Roqué Paniagua
7914d7d8d7 Merged PR 2028: guest journey estimated completed date
This PR includes the logic to handle the completed date of guest journey

Check the schema file to understand the logic implemented. It's an estimation, and in some cases, weird stuff happens on end dates before link usage dates, which effectively breaks the computation. I added a boolean for this

Related work items: #17268
2024-06-13 13:30:22 +00:00
Oriol Roqué Paniagua
6b4490b017 Merged PR 2020: Verification request completeness for intermediate steps + schema documentation
Add more detailed logic into the verification request completeness for intermediate stages. Added schema documentation

Related work items: #17268
2024-06-13 08:14:11 +00:00
Oriol Roqué Paniagua
328723b9ab Merged PR 2003: Business KPIs first draft
This PR aims to provide a first draft for business KPIs, at this stage **quite minimal**.

It mostly contains a MTD and Monthly display approach. No dimensions are created.

The models created are:
- **int_dates_mtd**: mainly it reads from int_dates to retrieve those days needed for a MTD/monthly display
- **int_core__mtd_booking_metrics**: it contains the booking metrics, ending in a format of date|value|value last year|increment
--> here we could add, in the future, additional metrics from other sources (ex: guest journey, etc)
- **int_core__mtd_aggregated_metrics**: it transforms the data coming from the different mtd intermediate sources to be easily displayed in the dashboard. This is a good candidate for macros :)
- **core__mtd_aggregated_metrics**: copy-paste of the its int_core version, including a bit of model documentation

The dashboard is functional but in another PR. I can show you how it looks like at the moment you are going to check the PR

Related work items: #17214
2024-06-11 15:45:57 +00:00
Pablo Martín
366aa7d1ac Merged PR 2005: Replace Guest Details in CheckIn Cover models with details coming from User table
Fixes https://guardhog.visualstudio.com/Data/_boards/board/t/Data%20Team/Stories/?workitem=17240

Related work items: #17240
2024-06-10 15:30:26 +00:00
Pablo Martin
2ea2817627 add tests 2024-06-10 16:23:45 +02:00
Pablo Martin
83e48ab6c6 mroe docs 2024-05-07 17:52:35 +02:00
Pablo Martin
67991800ef docs and moving stuff 2024-04-08 09:44:32 +02:00