Commit graph

1294 commits

Author SHA1 Message Date
Joaquin Ossa
b9968c7a72 added new metrics for not cancelled bookings 2024-11-06 12:34:52 +01:00
Joaquin Ossa
f5addc7f4c wip 2024-11-06 12:34:51 +01:00
Joaquin Ossa
9fecfeb91b Merged PR 3439: Weekly aggregated model
# Description

Created new PR to fix schema for test

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #23373
2024-11-06 11:11:07 +00:00
Oriol Roqué Paniagua
fd94c19694 Merged PR 3433: Change lifecycle daily to just handle last available day
# Description

Should improve performance of this daily lc model

# Checklist

- [X] The edited models and dependants run properly with production data.
- [ ] The edited models are sufficiently documented.
- [ ] The edited models contain PK tests, and I've ran and passed them.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.
2024-11-06 11:10:31 +00:00
Joaquin Ossa
41a9b55436 saved 2024-11-06 11:48:38 +01:00
Joaquin Ossa
51fabf9efb Changed test 2024-11-06 11:47:47 +01:00
Joaquin Ossa
8c7b4bcf94 Merged PR 3437: Revert 'Weekly aggregated guest journey metrics'
# Description

_Describe your motivation and changes here._

# Checklist

- [ ] The edited models and dependants run properly with production data.
- [ ] The edited models are sufficiently documented.
- [ ] The edited models contain PK tests, and I've ran and passed them.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

# Description

Here I created a weekly aggregated model for guest journey metrics.
I changed the daily_dimension week start and end to iso so it matches the week date obtained by Postgres for this aggregation

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [x] I have checked for DRY opportunities with other models and docs.
- [x] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Reverts !3430

Related work items: #23373
2024-11-06 10:27:37 +00:00
Joaquin Ossa
50b87c9d8f Revert "Merged PR 3430: Weekly aggregated guest journey metrics
# Description

Here I created a weekly aggregated model for guest journey metrics.
I changed the daily_dimension week start and end to iso so it matches the week date obtained by Postgres for this aggregation

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [x] I have checked for DRY opportunities with other models and docs.
- [x] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #23373"
2024-11-06 10:25:04 +00:00
Joaquin Ossa
60204b53e8 Merged PR 3430: Weekly aggregated guest journey metrics
# Description

Here I created a weekly aggregated model for guest journey metrics.
I changed the daily_dimension week start and end to iso so it matches the week date obtained by Postgres for this aggregation

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [x] I have checked for DRY opportunities with other models and docs.
- [x] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #23373
2024-11-06 10:17:46 +00:00
Joaquin Ossa
4a2c478d8f update schema 2024-11-06 11:11:06 +01:00
Joaquin Ossa
1cd9f88a45 Merged PR 3434: update assert_dimension_completeness test
# Description

Update assert_dimension_completeness test
I tested the models and everything seems to be working correctly
I tried to modify the test as you told me but I couldn't make it work Uri
`I think this could work with fewer repeated lines as well:
select * from discrepancy_{{ metric_column_name }}
{% if not loop.first %}
union all
{% endif %}`

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

update assert_dimension_completeness test
2024-11-06 07:59:44 +00:00
Joaquin
406499a7e0 Merge branch 'models/kpis_test_update' of ssh.dev.azure.com:v3/guardhog/Data/data-dwh-dbt-project into models/kpis_test_update 2024-11-06 08:35:50 +01:00
Joaquin
079eaac870 Update invoice models 2024-11-06 08:35:30 +01:00
Joaquin
ca510f91a7 update assert_dimension_completeness test 2024-11-06 08:29:02 +01:00
Oriol Roqué Paniagua
f5311fa954 Merged PR 3431: Adds Invoicing metrics
# Description

Same old story: includes all metrics coming from Xero.
Adds a daily model, monthly, mtd + monthly agg and mtd agg
A test to compare values new vs. old
AND fixes the issue I mentioned with the timestamp - an issue in the old KPIs.

# Checklist

- [X] The edited models and dependants run properly with production data.
- [X] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [NA] I have checked for DRY opportunities with other models and docs.
- [X] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #23565
2024-11-05 16:57:23 +00:00
Joaquin
0bffa5a862 update assert_dimension_completeness test 2024-11-05 16:45:59 +01:00
Joaquin
7e786649cc Weekly aggregated model 2024-11-05 16:04:41 +01:00
Joaquin
d8a064fd06 commit wip 2024-11-05 15:50:23 +01:00
Joaquin Ossa
4076f016bd Merged PR 3424: aggregated to agg
# Description

Changed names for all aggregated models to agg, updated all references and schemas.
I did a run and test and everything worked correctly

# Checklist

- [x] The edited models and dependants run properly with production data.
- [ ] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

aggregated to agg
2024-11-05 13:46:45 +00:00
Joaquin Ossa
76529fe457 Merged PR 3427: Weekly dimension
# Description

Added week values to the kpis__dimension_dates model for weekly aggregations

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Weekly dimension
2024-11-05 13:46:29 +00:00
Joaquin
c29a47240f Weekly dimension 2024-11-05 13:28:12 +01:00
Joaquin
d76b8ac205 fixed int_monthly_12m_window_contribution_by_deal 2024-11-05 12:53:27 +01:00
Joaquin
abd4a4e8f2 fixed int_monthly_growth_score_by_deal 2024-11-05 12:49:50 +01:00
Joaquin
5bcfd7cb9c Revert cross models 2024-11-05 12:37:31 +01:00
Joaquin
092e37d58c aggregated to agg 2024-11-05 12:17:26 +01:00
Oriol Roqué Paniagua
c21b05f9cf Merged PR 3420: Remove previous KPIs computation for Bookings, Guest Journeys and Guest Payments
# Description

Removes old computation of KPIs of Bookings, Guest Journeys and Guest Payments, after yesterday's switch to new computation.

It cleans 1) models 2) schema entries and 3) temporary tests.

# Checklist

- [X] The edited models and dependants run properly with production data.
- [NA] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them. **(Except for the duplicated Booking to Product Bundle)**
- [X] I have checked for DRY opportunities with other models and docs.
- [NA] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Remove previous KPIs computation for Bookings, Guest Journeys and Guest Payments

Related work items: #23576
2024-11-05 10:12:00 +00:00
Joaquin Ossa
f601b69c7d Merged PR 3418: CSAT score
# Description

Added CSAT score metrics, both average score as count of score to correctly aggregate for agg models

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [x] I have checked for DRY opportunities with other models and docs.
- [x] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

CSAT score

Related work items: #23372
2024-11-05 09:39:19 +00:00
Joaquin
57bc62b21d Merge branch 'models/23372_csat_guest_kpis' of ssh.dev.azure.com:v3/guardhog/Data/data-dwh-dbt-project into models/23372_csat_guest_kpis
Merge issue
2024-11-05 10:36:33 +01:00
Joaquin
2593632411 final changes 2024-11-05 10:29:50 +01:00
Joaquin
eb8e59f8c5 Addressed comments 2024-11-05 10:29:50 +01:00
Joaquin
ee2cb2e40e CSAT score 2024-11-05 10:29:50 +01:00
Joaquin
84b7f2569c final changes 2024-11-05 10:24:17 +01:00
Oriol Roqué Paniagua
b31a6ba194 Merged PR 3419: Adds Host Resolutions metrics in new KPIs
# Description

Adds 2 new metrics:
- xero_host_resolution_amount_paid_in_gbp
- xero_host_resolution_payment_count

Effectively it will split the "real" invoicing sources of revenue from "host resolution payments". This was already reading from 2 different Xero models (bank transactions vs. sales).

We have as usual:
- 1 Daily metric model
- 2 MTD/Monthly metric model
- 2 MTD/Monthly agg model (I already changed the name to agg instead of aggregated)
- 1 test to compare the values match the current setup

# Checklist

- [X] The edited models and dependants run properly with production data.
- [X] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [NA] I have checked for DRY opportunities with other models and docs.
- [X] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #23565
2024-11-05 07:45:41 +00:00
Joaquin
5d642d2c77 Addressed comments 2024-11-04 18:15:13 +01:00
Joaquin
392006b71c CSAT score 2024-11-04 16:51:24 +01:00
Oriol Roqué Paniagua
9b0c7161e3 Merged PR 3413: Exposes New KPIs of Bookings, Guest Journeys and Guest Payments
# Description

Exposes New KPIs of Bookings, Guest Journeys and Guest Payments in the 2 main flows: Monthly+MTD per Global, By Billing Country and By # of Listings Segmentation & Monthly By Deal

I did some checks on Global and By Billing Country and looks good.
I checked some examples for Monthly By Deal and looks good.

# Checklist

- [X] The edited models and dependants run properly with production data.
- [X] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [NO] I have checked for DRY opportunities with other models and docs. **Likely there's ways to create default configs for KPIs saying "hey, this is Main KPIs for a specific view so use this models and these filters". But at this stage since it's a transitional stage I don't want do overthink. Let's tackle this later on if that's ok for you. It means we will live with some repeated expressions**
- [X] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #23455
2024-11-04 14:52:38 +00:00
Joaquin Ossa
aeaf78df16 Merged PR 3411: Guest journey metrics attributed to check-in date
# Description

Here are all models for guest journey metrics attributed to check-in date with their monthly and MTD aggregation.
I did a little modification on the assert_dimension_completeness test so it can have a list of metrics to check instead of having to put it separately for each one, let me know what you think @<Oriol Roqué Paniagua> and I can update it for all other models that are using that test and update as well al names from aggregated to agg (Or should I just do it in a separate PR??)
I also checked the total values vs your models and the results make sense, there is some difference which is to be expected but nothing crazy.

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [x] I have checked for DRY opportunities with other models and docs.
- [x] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #23387
2024-11-04 14:51:35 +00:00
Joaquin
d952613fd3 Fixed names 2024-11-04 15:28:31 +01:00
Joaquin
64c3c6d1f0 Addressed comments 2024-11-04 14:29:26 +01:00
Joaquin
21858d4d59 updated test 2024-11-04 11:05:28 +01:00
Joaquin
7d3d11ea7f modified names 2024-11-02 18:32:38 +01:00
Joaquin
19337a9918 save all guest journey check in attributed models 2024-11-02 11:28:22 +01:00
Joaquin
3e5fd5a761 save models wip 2024-11-02 07:02:58 +01:00
Joaquin Ossa
231411ce93 Merged PR 3394: Guest KPIs daily metrics models
# Description

Created new models for the new Guest KPIs
These are for created, started and completed guest journeys and the highest granularity.
These includes date (day), id_deal, has_payment, has_check_in (government id), accommodation segmentation and billing country

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #23387
2024-10-31 16:45:58 +00:00
Oriol Roqué Paniagua
ea11c656d0 Merged PR 3400: Adding new claim NewDashVersion as an indicator for User Host
# Description

Adding new claim NewDashVersion as an indicator for User Host

# Checklist

- [X] The edited models and dependants run properly with production data.
- [X] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #23457
2024-10-31 16:40:48 +00:00
Joaquin
201e2c989c Addressed comments 2024-10-31 16:58:58 +01:00
Joaquin
813e710020 Update it to 1 model and added metrics including cancelled bookings 2024-10-31 16:58:40 +01:00
Joaquin
36a1428b23 Created models for new guest kpis 2024-10-31 16:56:29 +01:00
Joaquin
36432024b5 commit new models for guest kpis 2024-10-31 16:51:48 +01:00
Joaquin
6ae900530c save wip of started GJ 2024-10-31 16:51:48 +01:00