data-dwh-dbt-project/models/intermediate/cross
Oriol Roqué Paniagua 412e242f42 Merged PR 5586: Fix duplications on 1st of Month for Billable Items Growth Score
# Description

This relates to today's data alerts on Growth Score models.

Error has been found in `int_billable_items_growth_score_by_deal`. This only happens on the 1st of the month.

On the 1st day of the month we will have:
* The actual monthly data from KPIs in the previous month.

But also:
* Projected KPIs will still display data for the previous month, in this case though, projected = actuals.

There's a union all that combines actual monthly KPI data for history purposes and the projected data which fails in this case.

Fix is to remove the data from Projected KPIs if the current date of execution (1st of July) equals the first day of the month when computing `end_date` + 1 day. End date being at this moment 30th of June, + 1 day = 1st of July, extracting the first day of the month then 1st July.

# 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: #31665
2025-07-01 08:38:21 +00:00
..
int_billable_items_growth_score_by_deal.sql Merged PR 5586: Fix duplications on 1st of Month for Billable Items Growth Score 2025-07-01 08:38:21 +00:00
int_booking_summary.sql Merged PR 5366: Adds Incident data to Booking Summary 2025-06-02 15:56:54 +00:00
int_daily_currency_exchange_rates.sql go back to var, made a mistake in the last commit 2024-06-17 11:32:20 +02:00
int_dates.sql start cross folder in int to stop piling models at int root 2024-06-14 16:26:18 +02:00
int_deals_consolidation.sql ordered names to select oldest one created 2025-01-07 11:47:14 +01:00
int_edeposit_and_athena_verifications.sql Update athena models to remove id_accommodation 2025-02-24 15:21:44 +01:00
int_flagging_booking_categorisation.sql Merged PR 5366: Adds Incident data to Booking Summary 2025-06-02 15:56:54 +00:00
int_flagging_performance_analysis.sql Merged PR 4996: First tracking of flagging performance 2025-04-15 10:14:02 +00:00
int_monthly_account_revenue_impact_from_growth.sql Merged PR 5162: Fixes month shift on revenue share and rank 2025-05-08 06:15:44 +00:00
int_monthly_aggregated_metrics_history_by_deal_by_time_window.sql Merged PR 4907: KPIs Refactor Stage 2 - Decouple AM - Churn/Account Margin 2025-04-03 13:00:04 +00:00
int_mtd_aggregated_metrics.sql Add Flex API into KPI models 2025-06-11 14:44:07 +02:00
int_mtd_aggregated_metrics_by_deal.sql Merged PR 4959: Exclude data from model to improve performance 2025-04-09 08:13:44 +00:00
int_mtd_vs_previous_year_metrics.sql Add Flex API into KPI models 2025-06-11 14:44:07 +02:00
int_new_dash_deal_onboarding.sql Merged PR 5403: Removes test accounts 2025-06-06 12:17:49 +00:00
int_simple_exchange_rates.sql simple model 2024-06-14 16:44:40 +02:00
int_stay_disrupt_conversion_funnel.sql Merged PR 5322: First version of Stay Disrupt conversion funnel 2025-05-27 09:41:49 +00:00
int_unified_api_verifications.sql Merged PR 5047: First API unified version of Verifications 2025-04-24 12:21:50 +00:00
int_ytd_mtd_aggregated_main_metrics_overview.sql Merged PR 4882: Fix Business Targets 2025-04-02 07:32:11 +00:00
int_ytd_mtd_main_metrics_overview.sql Merged PR 4759: Adds Booking Fee per Billable Booking 2025-03-20 16:01:27 +00:00
schema.yml Merged PR 5366: Adds Incident data to Booking Summary 2025-06-02 15:56:54 +00:00