data-dwh-dbt-project/macros
Oriol Roqué Paniagua 9be6ec1dae Merged PR 5055: KPIs models for API Billable Verifications
# Description

Changes:
* 4 new models in the scope of KPIs for Billable Verifications from APIs. I believe it's more correct to say these are Billable Verifications than Billable Bookings since there's some cases in which a Booking can be duplicated and it's billed multiple times. These include:
* A daily metric model - extremely simple. You will notice there's no Billing Country not Listing Segmentation. This is because for ALL API cases this is UNSET, thus, I just remove it.
* An equivalent monthly metric model.
* Two aggregated models per dimension, dimension value: on a daily and a monthly basis.

Important change: the macro that handles the aggregations sets by default Billing Country and Listing Segmentation. I modified a bit the flow so the only required dimension is Global, and these are skipped for APIs models.

This is needed for the changes intended on the Growth score. In there, I'll combine both Platform Billable Bookings with API Billable Verifications.

Notice there's no MTD models. These could be added for sure; but since I'm not creating any metric in Main KPIs or similar, I opted to skip it for now. It can be done later 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: #29374
2025-04-24 15:01:04 +00:00
..
tests Helped with readability on test 2024-12-18 10:52:52 +01:00
.gitkeep start project 2024-01-18 11:24:35 +01:00
business_kpis_configuration.sql Merged PR 5055: KPIs models for API Billable Verifications 2025-04-24 15:01:04 +00:00
calculate_aggregation_between_preceeding_x_and_y.sql Merged PR 3967: Adds an "All History" time window to Account Margin 2025-01-07 15:22:30 +00:00
calculate_safe_relative_increment.sql Fixed macro 2025-01-24 14:17:29 +01:00
compare_table_hashes.sql Merged PR 4958: Add compare tables macro 2025-04-09 09:55:11 +00:00
cosmos_db_utils.sql DRY on stg cosmos db models 2024-09-19 15:17:33 +02:00
generate_schema_name.sql typo in macro 2025-03-24 11:58:15 +01:00
generate_stripe_sources_unioned_select.sql Create macro and use it in balance transactions 2024-03-05 13:33:13 +01:00
is_date_before_20th_of_previous_month.sql Update rule for metric depends on invoicing 2025-01-30 16:51:35 +01:00
return_capped_value.sql Fixed macro 2025-01-24 14:17:29 +01:00
unix_ms_timestamp_to_utc.sql add table alias optional argument to macro 2024-10-14 11:37:37 +02:00