Commit graph

360 commits

Author SHA1 Message Date
Joaquin Ossa
c95f551acf s&p update models 2024-12-17 19:09:54 +01:00
Joaquin Ossa
4569c5d0da Added the has_user_moved_from_old_dash field 2024-12-13 10:56:56 +01:00
Joaquin Ossa
f2394d89ac new link 2024-12-12 17:06:31 +01:00
Joaquin Ossa
52ecdc1046 update exposures 2024-12-12 16:46:45 +01:00
Joaquin Ossa
dbbfe2eb44 Changed description 2024-12-12 11:29:11 +01:00
Joaquin Ossa
e18750d720 Added nbr og nights to avoid calculation in PBI 2024-12-12 11:27:48 +01:00
Joaquin Ossa
85a02f8a1e Merged PR 3826: Check in Hero models
# Description

Check in Hero models for new report, it contains all records of check in hero API with user partner info

# 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.
- [ ] I've picked the right materialization for the affected models.

# Other

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

Check in Hero models

Related work items: #25403
2024-12-11 16:23:12 +00:00
Joaquin Ossa
34a5b0d86e Adding missing field in S&P models 2024-12-11 16:35:40 +01:00
Joaquin Ossa
11eecfec99 addressed comments 2024-12-11 16:13:34 +01:00
Joaquin Ossa
cbb93982d0 Check in Hero models 2024-12-11 14:32:39 +01:00
uri
c3d75bb143 Differentiate exposures 2024-12-09 17:22:16 +01:00
Oriol Roqué Paniagua
06603d01e2 Merged PR 3810: Adds is_end_of_month_or_yesterday for Main KPIs
# Description

Adds `is_end_of_month_or_yesterday` for Main KPIs.
Apparently, the fact that we do not show the ongoing value of the month on some tabs of Main KPIs is the main blocker for Ben C to consistently use Main KPIs, which he actually retrieves from the SH legacy reporting. Since I'm sceptical about the data shown there, I want to remove this blocker.
It will require a small PR on PBI as well.

# 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.
- [NA] 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: #25342
2024-12-09 16:13:52 +00:00
Joaquin Ossa
dfd7e50edd Changed it to API Reports and added E-Deposit Verifications 2024-12-09 11:12:37 +01:00
Joaquin Ossa
be6e87efb1 exposures update 2024-12-09 09:20:15 +01:00
Joaquin Ossa
1f683ec651 Final clarifications 2024-12-04 16:33:50 +01:00
Joaquin Ossa
2a19f1d19a Added ProtectionType 2024-12-04 14:36:49 +01:00
Joaquin Ossa
c8ee8bd456 intermediate and reporting models 2024-12-04 11:15:21 +01:00
Joaquin Ossa
d6f30a8e67 Added missing values 2024-12-03 10:37:05 +01:00
Joaquin Ossa
b03982b708 Added total fee cost of booking 2024-12-02 08:44:24 +01:00
Joaquin Ossa
1c9bb5ec31 model to reporting 2024-11-29 11:24:57 +01:00
Joaquin Ossa
fc2ee14acb Update exposures 2024-11-27 16:29:19 +01:00
Joaquin Ossa
4360258ac9 aggregated guest kpis to reporting 2024-11-26 16:43:56 +01:00
Oriol Roqué Paniagua
42d70f72d5 Merged PR 3667: Creates Chargeable metrics for New Dash KPIs
# Description

Creates the models for KPIs for New Dash - Chargeable metrics. In essence, computes 4 metrics:
- Chargeable Services
- Chargeable Amount (in GBP)
- Chargeable Bookings (unique over a time period and dimension, not additive)
- Chargeable Listings (unique over a time period and dimension, not additive)

This is done by creating:
- A Weekly Metric and Monthly Metric model. Here we keep the granularity of id_booking / id_accommodation to be able to compute the uniqueness.
- A Daily, Weekly and Monthly Aggregated models. Same as usual.
- Integrates everything to the existing model for Product New Dash Agg Metrics
- Exposes everything into reporting

NB: I removed on "by_host" in Created Services - I forgot to clear it out.

# 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: #20809
2024-11-26 14:19:41 +00:00
Joaquin Ossa
7717ce3c53 Added billing_country 2024-11-26 12:36:54 +01:00
Joaquin Ossa
658980e48f Modified name and changed date to group as an argument 2024-11-26 10:33:03 +01:00
Joaquin Ossa
0f5eb5fba2 Addressed comments 2024-11-26 10:16:08 +01:00
Joaquin Ossa
bede588062 generalized test 2024-11-26 09:27:13 +01:00
Oriol Roqué Paniagua
b0bed479c7 Merged PR 3625: Excludes new dash users without id deal
# Description

This PR has 2 commits:
- The first one handles the removal from the computation any user that has not an id deal properly set. I just created a boolean field in int_core__user_host that identifies if the host has no id_deal. Then apply the new condition in the 2 main usages of New Dash info.
- The second one cleans New Dash KPIs. Since we do not have anymore users without deals, it means that the identification of the host/account is going to be exactly the same if done by id_user_host or id_deal. I hated having id_user_host in KPIs so I've removed it :)

Lastly, this should speed up massively the execution. Not because there's improvements on the code but rather the reduction of data.

# 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: #20809
2024-11-21 16:30:47 +00:00
Oriol Roqué Paniagua
2e7c85d11b Merged PR 3616: Compute weekly new dash created services
# Description

Changes:
* Fixes weekly dates for KPIs. Before, joins were not working (but nothing was really used).
* Computes weekly new dash created services and exposes it to reporting

# 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.
- [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: #20809
2024-11-21 11:30:36 +00:00
Joaquin Ossa
77cfd36571 Removed guest metrics aggregated models 2024-11-21 09:14:37 +01:00
uri
888f0e325a Setting new kpis exposure for new dash overview report 2024-11-20 17:49:41 +01:00
Oriol Roqué Paniagua
4efb0aa1cc Merged PR 3607: Bugfix kpis__product_new_dash_agg_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.

Bugfix kpis__product_new_dash_agg_metrics
2024-11-20 12:44:56 +00:00
Oriol Roqué Paniagua
c23380583b Merged PR 3605: Beautification of Reporting String values
# Description

Creates a macro for beautification of categorical values.

# 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: #20809
2024-11-20 11:01:22 +00:00
Oriol Roqué Paniagua
86c81c1f21 Merged PR 3599: New Dash KPIs skeleton with Created Services
# Description

This PR handles the computation of KPIs for New Dash, focusing on Created Services.

New dimensions configured in `business_kpis_configuration` and applied in this new models for `NEW_DASH_CREATED_SERVICES`:
* `dim_host`,
* `dim_has_upgraded_service`,
* `dim_new_dash_version`,
* `dim_pricing_service`

New daily metric model `int_kpis__metric_daily_new_dash_created_services`
* Follows a similar pattern as for the rest of daily metric models. The only difference is that is aggregated to `id_booking` to ensure we can handle count distinct of bookings per different time granularities.
* Reads from the new pricing tables `int_core__booking_summary` and `int_core__booking_service_detail`. The main filters applied are selecting only new dash users and only services created after the user move timestamp to new dash.

An additional metric model at monthly level is created `int_kpis__metric_monthly_new_dash_created_services`

These finally go to a dimension aggregated model (`dimension`, `dimension_value`), respectively:
* Daily: `int_kpis__agg_daily_new_dash_created_services`
* Monthly: `int_kpis__agg_monthly_new_dash_created_services`

A final model aims to aggregate the different dimension aggregated metrics for New Dash: `int_kpis__product_new_dash_agg_metrics`
* It computes a `time_granularity` aggregation
* Here I will add additional metrics (such as revenue) once we have them.

A final model reading from the previous is exposed to reporting: `kpis__product_new_dash_agg_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: #20809
2024-11-20 09:43:30 +00:00
Joaquin Ossa
220e96749c Add week number to model 2024-11-18 11:23:25 +01:00
Joaquin Ossa
e01f189d7a reduced dates 2024-11-17 16:41:32 +01:00
Oriol Roqué Paniagua
321f48ca7d Merged PR 3506: Remove Address Validation
# Description

Removes Address Validation within DWH.
Note that I keep the 2 reporting fields, nullified. These should be removed after the removal of these fields in PBI.

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

Related work items: #23976
2024-11-14 11:59:36 +00:00
Oriol Roqué Paniagua
cce5d2b9d6 Merged PR 3490: Removal of other_sharing_platform_url
# Description

Removes other_sharing_platform_url field that will disappear from the backend in the release going out next week.

Apparently there's a dependency with a PBI report that uses core__unified_user table, so I just nullified the reporting field. The report is called users_dashboard, which AFAIK is not published anywhere. I wonder if this is one of the it-should-not-exist report. Waiting for tomorrow confirmation with Pablo.

Important note: Since this removes fields from staging, which is incremental, we need to trigger a full-refresh for this table. Otherwise execution will fail.

# 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.
- [NA] I have checked for DRY opportunities with other models and docs.
- [NA] I've picked the right materialization for the affected models.

# Other

- [X] Check if a full-refresh is required after this PR is merged. **Yes, please refer to my previous comment.**

Related work items: #23974
2024-11-13 09:23:42 +00:00
Joaquin Ossa
6f77309b8c addressed comments 2024-11-12 17:10:42 +01:00
Joaquin Ossa
463f5edfc3 new dash new data 2024-11-12 16:33:55 +01:00
Joaquin Ossa
edd588b3b4 delete b lol 2024-11-12 14:48:09 +01:00
Joaquin Ossa
7e5451604c Guest KPIs reporting 2024-11-12 14:41:01 +01:00
Oriol Roqué Paniagua
aaba27a0ea Merged PR 3500: Fix missing test
# Description

Fix missing test :)

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

Related work items: #23763
2024-11-11 16:37:58 +00:00
Oriol Roqué Paniagua
9ba0edb82d Merged PR 3482: Adapts date dimension skeleton for Main KPIs
# Description

New model:
* int_kpis__agg_dates_main_kpis - Serves as the skeleton of dates and dimensions for Main KPIs. It's aggregated since it follows a similar aggregation strategy. It's a single model to feed both Main KPIs visualisations. Note boolean fields are real booleans (true/false) while before these were integers (1/0). This also affects downstream models.

Main KPIs flow adaptations to new skeleton model:
* int_monthly_aggregated_metrics_history_by_deal
* int_monthly_churn_metrics - additionally, calls usual KPIs macro instead of old one
* int_mtd_vs_previous_year_metrics

Reporting changes to ensure report is not down:
* mtd_aggregated_metrics - adaptations on booleans (true-1, false-0)

Cleaning:
* get_kpi_dimensions macro is no longer used
* int_dates_by_deal model and schema entry
* int_dates_mtd_by_dimension model and schema entry
* int_dates_mtd model and schema entry

# 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: #23763
2024-11-11 15:57:37 +00: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
689ea53c11 Merged PR 3290: Update exposure of top losers - now account managers overview
# Description

Updates exposure entry for the previous top losers. Now it will become account managers overview. Link is also up to date

# Checklist

- [NA] The edited models and dependants run properly with production data.
- [NA] The edited models are sufficiently documented.
- [NA] 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.
- [NA] 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: #23170
2024-10-22 14:14:58 +00:00
Oriol Roqué Paniagua
f426825c47 Merged PR 3286: Rename of categories for top losers/winners
# Description

Re-aligned namings with Matt and Alex. This PR just changes the top losers, losers, winners and top winners to major decline, decline, gain and major gain respectively

# 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.
- [NA] I've picked the right materialization for the affected models.

# Other

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

Rename of categories for top losers/winners

Related work items: #23170
2024-10-22 13:06:58 +00:00
Oriol Roqué Paniagua
6a90eb30f9 Merged PR 3272: Expose Churn Rates into Main KPIs
# Description

Exposes Churn Rates into Main KPIs, specifically Revenue Churn Rate, Bookings Churn Rate and Listings Churn Rate. This is based on the average approach.

Additionally, it adds these 3 metrics in the kpis_additive_metrics_per_dimension_are_consistent test.
Additionally, it removes from int_mtd_vs_previous_year_metrics the computation of the additive Churn Rates. The removal of further unused code will be handled in a separated 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.
- [NA] 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.

Related work items: #22691
2024-10-22 08:08:03 +00:00
Oriol Roqué Paniagua
f230eb3af5 Merged PR 3247: Enriches monthly_growth_by_deal model for top losers reporting
# Description

Changes:
* Explicit selection of fields in the last part of the query, rather than select *.
* Adding a few more Hubspot attributes, namely: AM, Hubspot Stage, Live Date and Cancellation Date. The main idea is to enrich the reporting with these.
* Adding the listings over 12 months. Here it's a bit more tricky than for Revenue or Bookings, since to me the main indicator is the amount of listings that are being booked in a month, over a period of 12 months (rather than unique count of listings that have been booked in the past 12 months). However, doing a sum of the listings booked in month will be very tricky for AMs and other users. I opted for averaging, and can be considered as, in average, a certain account has X amount of listings with bookings created, and this average considers the past 12 months. So I'd say it's a good estimate of the "real" size of a client in terms of potential for Superhog.

# 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.
- [NA] 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: #22883
2024-10-18 13:17:52 +00:00