Commit graph

13 commits

Author SHA1 Message Date
Pablo Martin
c3c628aec4 change "tests:" to "data_tests:" 2025-01-13 16:00:35 +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
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
7e5451604c Guest KPIs reporting 2024-11-12 14:41:01 +01:00