Commit graph

229 commits

Author SHA1 Message Date
Oriol Roqué Paniagua
dc0abe6098 Merged PR 5403: Removes test accounts
# Description

This PR directly removes test accounts, and not just flag them, from:
* `int_core__unified_user`, which means is also propagated to `int_core__user_host`.

It does so by creating a new, extremely simple model named: `int_core__user_test_account`

Then, `int_core__user_host` is inner joined with a small explanation comment on:
* `int_core__accommodation`
* `int_core__unique_accommodation_to_user`
* `int_core__bookings`
* `int_core__verification_requests`
* `int_core__payments`

Effectively removing test accounts.

Lastly, any existence and usage of the column `is_test_account` has been removed -> mostly on New Dash-related models.

# Checklist

**As discussed in the daily, I'll be playing around in prod with this PR**

- [ ] 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.

Related work items: #27319
2025-06-06 12:17:49 +00:00
Oriol Roqué Paniagua
affeac612a Merged PR 5366: Adds Incident data to Booking Summary
# Description

This PR moves the categorisation of Bookings with Incidents from the flagging specific model to Booking Summary, effectively keeping this at Booking ID level.

This also handles the direct dependency with the flagging categorisation model.

I also improved the documentation and test coverage on the Booking Summary as it's becoming more and more central to many areas.

# 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: #30676
2025-06-02 15:56:54 +00:00
Oriol Roqué Paniagua
d33e5ff2b2 Merged PR 5353: Switch int_core__booking_summary to int_booking_summary
# Description

This PR does the following:
* Moves `core/int_core__booking_summary` to `cross/int_core__booking_summary`
* Renames the model `cross/int_core__booking_summary` to `cross/int_booking_summary`
* Same for schema entry. In the new schema, I just added in the description how to retrieve exclusively New Dash Bookings for usability purposes.

Then, it adapts any dependency on `int_core__booking_summary` to `int_booking_summary`

No additional changes - inclusion of Resolution Incidents data will come later in a different PR.

# 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: #30676
2025-05-30 12:51:10 +00:00
Oriol Roqué Paniagua
06a4f679ea Merged PR 5322: First version of Stay Disrupt conversion funnel
# Description

First version of Stay Disrupt conversion funnel. It's a simple monthly compute of:
Active accounts -> Accounts that offered SD in GJ started in month -> Accounts that have had payments paid of SD in month
Total Guest Journeys Started -> GJ that offered SD in month-> Payments paid of SD in month

Some details:
* It also includes CIH, and data starts on 1st Jan 2025. This is to create report. This needs to be changed once the report is created.
* Note that Accounts that offered SD in GJ started in month and GJ that offered SD in month is equal to 0 as no data flows through the new flow. The rest has data.
* I consider all users, not only New Dash, knowing that I don't know if someone knows which users will have a certain Guest Product enabled.

Model is "agnostic" to the GP if we want, though the name still aims to be only for SD.

# 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. **View to start with**

# Other

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

Related work items: #30277
2025-05-27 09:41:49 +00:00
Oriol Roqué Paniagua
9f7f92912f Merged PR 5311: Adds Confident Stay Revenue as a Main KPIs and Account Performance metric
# Description

Creates a new metric: Confident Stay Revenue.

This includes:
* Setting the computation in `int_mtd_vs_previous_year_metrics`
* Configuring the metric behavior in `int_mtd_aggregated_metrics`. It follows the same as CIH.
* Adding the metric in the completion test. I didn't add it in the outlier test in purpose as any new value would trigger the outlier since there's no history to compare against.

Few notes:
* I confirm it displays no value, as the product has not been launched.
* Note that the inclusion of Confident Stay in Guest Revenue was already handled in the previous PR.

Next steps to complete the ticket:
* Add in the Data Glossary of Main KPIs the definition of Confident Stay Revenue
* Add in the Data Glossary of Account Performance the definition of Confident Stay Revenue

# 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.
- [N/A] I have checked for DRY opportunities with other models and docs.
- [N/A] 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: #30278
2025-05-26 09:22:15 +00:00
Oriol Roqué Paniagua
14c099b6b2 Merged PR 5296: Drop Monthly Growth Score By Deal legacy models
# Description

Drop Monthly Growth Score By Deal legacy models in Intermediate and Reporting.
This includes schema entries.
These models were already identified as to be deprecated on the 23rd May 2025, so, today.

# Checklist

- [X] Project compiles, no additional warning is raised.

Related work items: #29826
2025-05-23 10:32:56 +00:00
Oriol Roqué Paniagua
56aeb701cd Merged PR 5256: Reporting version of New Dash Onboarding
# Description

Reporting version of New Dash Onboarding

It also adds a missing description of a field.
It also adapts the logic for Hubspot Onboarding Owner, after a discussion with Alex. It still does not cover 100% of the cases but he's investigating the rest.

# 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: #30249
2025-05-19 15:41:48 +00:00
Oriol Roqué Paniagua
8c7c3e84cf Merged PR 5246: Ordered services in HS and added new boolean
# Description

Improvements on onboarding data:
* Hubspot services that clients expressed their interest in are now sorted alphabetically. This is needed for:
* A new boolean to compare current active services applied in listings vs. services that captured the interest of the client on onboarding. This can help identify clients that we might need to follow up to ensure all programs are created and applied.

# 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: #30249
2025-05-19 08:40:14 +00:00
Oriol Roqué Paniagua
5455bd2c01 Merged PR 5242: Adds new model in intermediate for new dash deal onboarding
# Description

Adds new model in intermediate for new dash deal onboarding.
Adds additional fields in new dash tables for services completion at program level.

# 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: #30249
2025-05-16 17:09:30 +00:00
Oriol Roqué Paniagua
a3038089e8 Merged PR 5162: Fixes month shift on revenue share and rank
# Description

Fixes the Account Growth issue on the rank/share on revenue metrics.

Issue was that the share needs to be shifted one month for account computation; meaning that the impact score of April relies on the share from March (as there's no April revenue data).

The shift also affected the rank as it's based on the share.

Solution is:
* Re-bring actual revenue share and attribute it to the correct month
* Apply a coalesce giving priority to the revenue share/rank from the correct month. If no data is available (ongoing month), show share/rank of previous month. This is intended to help quantify account importance in the ongoing month - as it's actually the case in the report

Tested locally + run in prod to check the report performance. Small note, this makes revenue share not adding up anymore to 100% as accounts that go live in the same month are excluded. This is exactly the same as for Billable Items.

# 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: #30013
2025-05-08 06:15:44 +00:00
Joaquin Ossa
fb3a8c7bfa Merged PR 5131: Remove old models
# Description

Remove old models:
- `monthly_aggregated_metrics_history_by_deal`
- `int_monthly_aggregated_metrics_history_by_deal`

# 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.

Remove old models

Related work items: #29672
2025-05-05 14:00:21 +00:00
Joaquin
a265b01672 Remove old models 2025-05-05 14:47:22 +02:00
Oriol Roqué Paniagua
09e599308c Merged PR 5129: Update exposures/deprecation dates on AM reporting
# Description

Updates deprecation dates to 23rd May.
Updates exposure with new Account Growth report

# Checklist

- [X] Project compiles

Related work items: #29374
2025-05-05 07:09:41 +00:00
Oriol Roqué Paniagua
ca5be5c3cf Merged PR 5069: Account revenue impact from growth in a monthly basis
# Description

Creates an intermediate model to compute the impact in revenue (total or rrpr) due to the growth.
This model also categorises the impact, and provides additional attributes for reporting purposes.

This model aims to substitute, in time, the current existing version of `int_monthly_growth_score_by_deal`.

# 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: #29374
2025-04-28 09:36:25 +00:00
Oriol Roqué Paniagua
0ffcfca6a8 Merged PR 5058: Propagate API deals to growth score
# Description

I opted to name the combination of (Platform) Billable Bookings and (API) Billable Verifications as Billable Items. This is to ensure consistent naming.

Changes:
* Renamed `int_kpis_projected__agg_daily_billable_bookings` to `int_kpis_projected__agg_daily_billable_items`. This now has a new CTE named combination_of_billable_items that combines both API and Platform billable items. Renamed any "bookings" field to "items".
* Renamed `int_kpis_projected__agg_monthly_billable_bookings` to `int_kpis_projected__agg_monthly_billable_items`. Renamed any "bookings" field to "items".
* Renamed `int_billable_bookings_growth_score_by_deal` to `int_billable_items_growth_score_by_deal`. This now has a new CTE named `aggregated_monthly_billable_items` that combines the historical information both API and Platform on billable items. Renamed any "bookings" field to "items".
* Changes Schema accordingly. Small note here that the assert dimension completeness stops working since there's dimensions specific to API or Platform, thus I removed it.

# 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: #29374
2025-04-25 07:27:22 +00:00
Oriol Roqué Paniagua
653666abad Merged PR 5044: Switch Projected Created Bookings to Billable Bookings
# Description

Switches Created Bookings to Billable Bookings in the scope of Projected Bookings. I opted for hard switching (thus removing Projected Created Bookings) altogether to avoid having unused models in production.

This aims to set the ground to include, in the future, APIs Billable Bookings.

Impact in KPIs:
* `int_kpis__agg_daily_created_bookings` now is `int_kpis__agg_daily_billable_bookings`. Aside from the name change, it's reduced to 4 metrics to just one. Schema changes also apply.

Impact in Projected KPIs:
* `int_kpis_projected__agg_daily_created_bookings` now is `int_kpis_projected__agg_daily_billable_bookings`. Fields are also renamed accordingly.
* `int_kpis_projected__agg_monthly_created_bookings` now is `int_kpis_projected__agg_monthly_billable_bookings`. Fields are also renamed accordingly.
* Schema file is also updated accordingly.

Impact on new model for Growth Score:
* `int_created_bookings_growth_score_by_deal` now is `int_billable_bookings_growth_score_by_deal`. Fields are also renamed accordingly.
* Schema is also updated accordingly.

Note that since the end model `int_billable_bookings_growth_score_by_deal` is not used at the moment in reporting, there's no user-facing impact. Also, the rest of modified models are not used for other purposes.

# 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: #29374
2025-04-24 12:42:21 +00:00
Oriol Roqué Paniagua
ca2311d935 Merged PR 5047: First API unified version of Verifications
# Description

Creates a first unified version of API verifications. This is a very simple model as it aims to capture the minimal essence of Verifications in a unified view. Any very-in-depth-API-specific detail is not available here.

Additionally, I propagated the Check-in date in the Athena model.

This is needed for API Bookings KPIs future 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. **Currently as a view, despite it's 70k records. If this grows we could consider other materialisations**

# Other

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

Related work items: #29374
2025-04-24 12:21:50 +00:00
Oriol Roqué Paniagua
a944a873d7 Merged PR 5014: New Created Bookings Growth Score
# Description

After checking the current growth score model... I think I will decommission it for something simpler.

This PR introduces a new growth score purely based on Created Bookings, thus it won't work for API deals. For API deals I will do a similar Total Revenue comparison separately.

This uses the projected bookings at the end of the month, thus this is updated in a daily basis and it's timely.

# 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: #29374
2025-04-24 07:10:39 +00:00
Oriol Roqué Paniagua
45514dcd6a Merged PR 5012: Small refactor on Growth Score
# Description

Small refactor on Growth Score model. It just handles the dimension deals attributes at the end instead of having these in each CTE.

I also forced a partition ordered by deal AFTER the current ordering. This is a side effect because SQL randomly choses a value if the value being used to order was exactly the same (ex: revenue = 0). This was causing issues when auditing the refactor.

# 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: #29374
2025-04-17 10:01:15 +00:00
Oriol Roqué Paniagua
6e354e7df1 Merged PR 5010: Adds missing payout amount computation for full consistency
# Description

Technically, a payout can be submitted while not in a finished incident state. Likely next step from res perspective is just to close the ticket.

This PR just adds two new fields for completion and consistency, and fixes the completion test so it makes sense.

# 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.
2025-04-17 08:15:37 +00:00
Joaquin Ossa
84eda4554f Merged PR 5005: New API invoices
# Description

Added new invoices metrics for CIH and S&P API for KPI and Accounting 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.
- [ ] 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.

New API invoices

Related work items: #29276
2025-04-16 15:24:25 +00:00
Oriol Roqué Paniagua
cae6d791b5 Merged PR 5007: Deprecation of monthly_aggregated_metrics_history_by_deal models
# Description

Deprecation of monthly_aggregated_metrics_history_by_deal models

dbt Compiles

Related work items: #29204
2025-04-16 15:19:09 +00:00
Joaquin
e8cab61787 Addressed comments 2025-04-16 16:18:14 +02:00
Joaquin
2c7e396c2c New API invoices 2025-04-16 14:27:23 +02:00
Oriol Roqué Paniagua
4922fce426 Merged PR 5001: Payouts amounts attributed to Bookings
# Description

Adds monetary value in terms of payouts for further understanding of the potential impact on improving the flagging.

# 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: #29284
2025-04-16 06:48:39 +00:00
uri
e981cc1739 Fix schema 2025-04-15 13:37:57 +02:00
Oriol Roqué Paniagua
a2cad661dd Merged PR 4996: First tracking of flagging performance
# Description

Creates 2 new models in the scope of flagging: how good are we at identifying "at risk" bookings vs. 1) the number of claims generated and 2) the number of submitted payouts?
This only applies for Protected Bookings in New Dash that have been completed (14 days after the check-out) with potential resolutions appearing in Resolutions Center.

The first table `int_flagging_booking_categorisation` contains all the heavy logic to categorise the bookings.

The second view `int_flagging_performance_analysis` computes standard binary classification scores, for the 2 possible ways of tracking.

Tables are already in prod to help you understand while reviewing. You'll see that the figures are still quite low, specially due to small amount of claims/submitted payouts. This makes the true positives being just... 1.

There's heavy test and documentation coverage to ensure there's no mistakes on the computation.

# 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. **Materialising as table the first model despite being just 1 record since otherwise tests takes ages**

# Other

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

Related work items: #29284
2025-04-15 10:14:02 +00:00
Oriol Roqué Paniagua
587661f818 Merged PR 4977: More robust testing on key metrics
# Description

Adds more robust testing for Total Revenue and Revenue Retained Post-Resolutions in:
* int_mtd_vs_previous_year_metrics
* int_ytd_mtd_main_metrics_overview

# 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.

More robust testing on key metrics

Related work items: #29227
2025-04-10 13:06:04 +00:00
Oriol Roqué Paniagua
fa6114b2af Merged PR 4970: Fix data quality issue on Revenue Retained metrics
# Description

As raised by Kayla, Retained metrics are not computed correctly in AM Account Margin report, see screenshot:

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

Issue lies in the fact that Guest Payments contains more dimensions than the rest of the models. This is generating duplicates in the combination_of_sources CTE, but these are effectively hidden because of the sum() applied of the metrics.

In the case of a Deal having in the same day Guest Payments with different dimensions from those selected, AND on the same day having a value on Invoiced Revenue or Host Resolutions, then the Invoiced Revenue or Host Resolutions would be duplicated.

This PR aims to fix this issue, and also adds a few tests on the base model for AM Account Margin to ensure this is kind of error raises an alert.

I'll be debugging other affected models and increase the robustness test-wise; as well as gathering the full impact.

# 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: #29227
2025-04-10 07:23:31 +00:00
Oriol Roqué Paniagua
55f8b47faa Merged PR 4959: Exclude data from model to improve performance
# Description

Small changes to exclude "irrelevant" data. All data is relevant I guess but this is less.
* Exclude churned accounts after 3 months.
* Exclude any data after 24 months.

# 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: #28998
2025-04-09 08:13:44 +00:00
Oriol Roqué Paniagua
a67e3f46ba Merged PR 4948: Reporting model for mtd aggregated metrics by deal
# Description

Creates a new model for reporting. It includes any relevant metric at Deal level in a similar format as we do for `mtd_aggregated_metrics`. Additionally, there's few Deal attributes - from Hubspot, segmentations, lifecycles, etc.

In order to dynamically choose which metrics are relevant on a Deal level, I modified the configuration in `int_mtd_aggregated_metrics` so the extraction is under control.

# 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. **Worth discussing the possibilities to include indexes in the future**

# Other

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

Related work items: #28998
2025-04-08 10:04:11 +00:00
Oriol Roqué Paniagua
ca5db795a3 Merged PR 4946: Allows By Deal dimension to be propagated within intermediate
# Description

To be able to compute By Deal KPIs  similarly as we do for Main KPIs we need to propagate the "By Deal" dimension first in intermediate. This does not impact reporting since there's a macro that already cuts the dimensions to be displayed, but I modified the name so it's clearer.

Changes:
* In `int_mtd_vs_previous_year_metrics`, I added a new `dimension_list`. This is applied to all initial CTEs that filter by dimension. Note that I added here the `by_deal` dimension.
* Modified the name of `get_kpi_dimensions_for_production` to `get_main_kpis_dimensions_for_production`. Now it's more explicit that this is the configuration for Main KPIs reporting. This affects both `business_kpis_configuration` and it's usage in `mtd_aggregated_metrics`.
* Modified the tests in `int_mtd_vs_previous_year_metrics` and `int_mtd_aggregated_metrics` to include the new dimension `by_deal`.
* It seems by adding this now autoformatting works again on this model! I'll tag all cases that are just because of autoformatting.

MD5 trick has been applied in `reporting.mtd_aggregated_metrics`.

# 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: #28998
2025-04-08 05:37:53 +00:00
Oriol Roqué Paniagua
17f38b2106 Merged PR 4942: KPIs Refactor Stage 4 - Remove old onboarding mrr models
# Description

Removes old onboarding mrr models, that are no longer used.

dbt compiles correctly and no deprecated warning is showing anymore.

This finishes the refactor

Related work items: #28949
2025-04-07 14:30:08 +00:00
Oriol Roqué Paniagua
34ac83b3ec Merged PR 4941: KPIs refactor Stage 4: Switch onboarding MRR to new KPIs model
# Description

Puts in production the new KPIs model for Onboarding MRR.

The change has been validated with MD5 trick.

# 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: #28949
2025-04-07 14:07:00 +00:00
Oriol Roqué Paniagua
446bd7f7d3 Merged PR 4932: KPIs Refactor Stage 4 - Tag Onboarding MRR models as deprecated
# Description

Tags as deprecated the following models:
* `int_monthly_onboarding_mrr_per_deal`
* `int_mtd_agg_onboarding_mrr_revenue`

Project compiles.

Related work items: #28949
2025-04-07 06:47:40 +00:00
Oriol Roqué Paniagua
63aebf4220 Merged PR 4931: KPIs Refactor Stage 3 - Remove previous Churn models
# Description

Removes the models:
* int_monthly_12m_window_contribution_by_deal
* int_monthly_churn_metrics

as well as their entries in the schema files.

Project compiles and KPIs run works.

This closes stage 3 of the refactor.

# 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.

Remove previous Churn models

Related work items: #28948
2025-04-07 06:41:07 +00:00
Oriol Roqué Paniagua
4b9babf6b4 Merged PR 4928: KPIs Refactor Stage 3 - Expose Churn from KPIs
# Description

Small but important change.

Churn metrics will be propagated in production by sourcing intermediate/kpis rather than the cross 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.

Related work items: #28948
2025-04-04 14:49:43 +00:00
Oriol Roqué Paniagua
5a5bdd82d5 Merged PR 4916: Deprecation of Churn Models
# Description

Churn models being tagged as deprecated for next week, for information.

# 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.

Deprecation of Churn Models

Related work items: #28948
2025-04-03 15:58:44 +00:00
Oriol Roqué Paniagua
f6d25f681f Merged PR 4907: KPIs Refactor Stage 2 - Decouple AM - Churn/Account Margin
# Description

Decouples Churn/Account Margin model of `int_monthly_aggregated_metrics_history_by_deal_by_time_window` from the model `int_monthly_aggregated_metrics_history_by_deal`.

Changes:
* Removes dependency and reads from KPIs models.
* Removes unused deal stage variable
* Jinja template for time windows with dynamic selection to DRY

This has been tested with dbt audit tools and the md5 for pure refactoring, so output is exactly the same.

# 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: #28947
2025-04-03 13:00:04 +00:00
uri
80f14c7b72 Refactor growth score by deal to stop depending on cross models 2025-04-02 16:57:19 +02:00
Oriol Roqué Paniagua
0fd9b2ce06 Merged PR 4887: Adds audit helper + finishes KPIs Refactor Stage 1
# Description

Adds audit helper.
Removes computation of Total and Retained Revenue from cross models.

I've tested audit helper and the trick with the hashes, as discussed in the demo.

# 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. **Except for today's outlier detector!**
- [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: #28946
2025-04-02 14:03:33 +00:00
Oriol Roqué Paniagua
0b75afbe39 Merged PR 4882: Fix Business Targets
# Description

Fixes Blank stuff

# 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.

Fix Business Targets

Related work items: #28958
2025-04-02 07:32:11 +00:00
Oriol Roqué Paniagua
8924778a52 Merged PR 4770: Same freshness in MTD and YTD/target for Resolutions Payouts
# Description

Ensures Resolutions Payouts (in amount paid) is timely

# 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.

Same freshness in MTD and YTD/target for Resolutions Payouts

Related work items: #28560
2025-03-21 11:10:26 +00:00
Oriol Roqué Paniagua
98c40d21d2 Merged PR 4769: Refactors display exclusion in main metrics
# Description

I noticed this morning that after the name changes some exclusions have been messed up.

I think is about time we handle this properly. Following what we did for `ytd_mtd_aggregated_main_metrics_overview`, I apply the same logic: the metric display configuration is handled for each metric in the configuration rather than by some crazy-complex-name-logic.

I also took the opportunity to make Host Resolutions timely after a discussion with Chloe yesterday. Finance handles resolutions payments twice a week, and the "delay" in time is mostly coming from Resolutions accepting to pay someone vs. Finance handling the payment. In any case we're talking about a few days maximum difference, which I believe it's 1) process-related freshness, rather than data-related and 2) much better to have visibility in a timely manner rather than waiting for the 20th on next month.

# 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. **Logic is common among YTD and MTD models. At some moment this can be improved**
- [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: #28560
2025-03-21 09:40:20 +00:00
Oriol Roqué Paniagua
240d6ec59e Merged PR 4763: Align metrics within KPIs report
# Description

There's misalignment in the different areas in the business, but even within our own report...

**I'm not saying this is perfect** - but at least it forces a common Data Glossary within Main KPIs. I'd suggest later on reviewing naming - same as we need to do for revenue anyway -, but for the meantime, at least have consistency on our side.

Changes:
* Est. Billable Bookings -> Billable Bookings. We have other metrics stated as Estimated in the Data Glossary.
* Waiver and Resolutions payments to host are now called Payouts. This is not perfect but at least is clear we're paying out, so it's a cost.
* Host Resolutions Payment Rate is now explicitly mentioning how it's being computed to avoid confusion with the Payout Rate, that does not appear here yet, but appears in the YTD.

Additional Changes:
* Tests are also aligned with new names.
* Re-order booking display, so Cancelled Bookings (inclusion and exclusion) are shown below. Having them the first is weird.

# 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: #28560
2025-03-20 17:00:36 +00:00
Oriol Roqué Paniagua
6b9434355a Merged PR 4759: Adds Booking Fee per Billable Booking
# Description

Changes:
* Creates Booking Fees in YTD/MTD
* Creates Booking Fees per Billable Booking in YTD/MTD. This is exposed forward.
* Removes code for Onboarding MRR in YTD/MTD.

Additional fixes:
* Small mistake - Revenue Churn is now considered as NEGATIVE

# 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: #28560
2025-03-20 16:01:27 +00:00
Oriol Roqué Paniagua
098ab51439 Merged PR 4757: Creates a Total Booking Fees metric (Old dash + New dash)
# Description

Main Changes:
* Computes the total booking fees in `int_kpis__metric_daily_invoiced_revenue`
* Propagates within KPIs, including schema and tests
* Propagates within cross in both "by deal" and "by dimension/global"
* Propagates to main kpis tests

Small fix:
* In `int_mtd_vs_previous_year_metrics`, manual formatting because sqlfmt is broken on this model...

# 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: #28560
2025-03-20 13:45:44 +00:00
Oriol Roqué Paniagua
93b31854f7 Merged PR 4754: Updates targets FY25 & FY26
# Description

Main changes:
* Modifies target seeds to include FY2025 and FY2026. This includes now absolute values for equivalent rate metrics. This also includes Booking Fees per Billable Booking, despite this metric is still not computed. This will be done in a separated PR.
* Removes Onboarding MRR as this requirement is no longer needed, and there has not been any target computed for this metric. This is modified to include Revenue Churn as an absolute figure.

Small note. Targets for FY 2025 rely on the actuals from Finance. Up to January 2025 included, these should match with our YTD values, but it's not the case due to small differences in Billable Bookings / Deals; as well as accrued revenue. Accrued revenue is very troublesome specially on Guesty side, since this affects Total Revenue, and this affects also Resolutions Payout Rate, and so on...

# 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: #28560
2025-03-20 13:10:22 +00:00
Oriol Roqué Paniagua
f799a8d30f Merged PR 4727: Bookings fees are now Old Dashboard Booking Fees in Main KPIs
# Description

Booking fees is widely used with different meanings, for old dash, for new dash, for both, etc. This is painful. First step to align on a proper naming is ensure that what we report in Main KPIs is clearly stated, which in this case, Booking Fees are now called Old Dashboard Booking Fees.

Changes:
* Modify `stg_seed__accounting_aggregations` seed to rename Booking Fees to Old Dashboard Booking Fees. This is for us to clarify. This is only applied for KPIs compute. I also added an empty space that I mistakenly forgot in the past for `financial_l3_aggregation`.
* Modify KPIs source, i.e., `int_kpis__metric_daily_invoiced_revenue`. Here I forcefully modify the name of the field to `xero_old_dashboard_booking_net_fees_in_gbp`.
* Propagate changes of downstream usages of `xero_booking_net_fees_in_gbp` to `xero_old_dashboard_booking_net_fees_in_gbp`. This affects all models, including the reporting model. On this one we still have both names to avoid breaking it. I will need to modify the data glossary in PBI anyway so I'll do this change as well.
* Modify displayed metric name from Booking Fees Revenue to Old Dashboard Booking Fees Revenue.
* Modify schema so it reflects the proper names, descriptions, and tests.
* Ensure outlier and completion tests still work after this change.

I confirm the field `xero_booking_net_fees_in_gbp` does not exist anymore in the rest of DWH after these changes, except for the abovementioned comment on the reporting line.

# 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: #28560
2025-03-18 14:55:32 +00:00
Joaquin
e9cfb6c2bd Addressed comments 2025-03-14 14:20:57 +01:00