Merged PR 4500: Revert "Relative increments with sign"

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

Revert "Relative increments with sign"

Reverted commit `f5718ded`.
This commit is contained in:
Oriol Roqué Paniagua 2025-02-25 11:43:05 +00:00
parent f5718ded4d
commit 5eebb4f560
4 changed files with 27 additions and 159 deletions

View file

@ -2131,38 +2131,3 @@ models:
description: |
Achievement rate between the current year YTD and the EOFY target. It can be null
if the target is not available.
- name: rel_diff_with_sign_current_month_mtd_vs_previous_month_eom
data_type: numeric
description: |
Relative difference between the current month MTD and the previous month EOM,
with a sign to represent if the relative difference is good (positive) or bad
(negative) for our business.
- name: rel_diff_with_sign_current_month_mtd_vs_previous_year_mtd
data_type: numeric
description: |
Relative difference between the current month MTD and the previous year MTD,
with a sign to represent if the relative difference is good (positive) or bad
(negative) for our business.
- name: rel_diff_with_sign_current_ytd_vs_previous_ytd
data_type: numeric
description: |
Relative difference between the current year YTD and the previous year YTD,
with a sign to represent if the relative difference is good (positive) or bad
(negative) for our business.
- name: rel_diff_with_sign_current_month_mtd_vs_eom_target
data_type: numeric
description: |
Relative difference between the current month MTD and the EOM target,
with a sign to represent if the relative difference is good (positive) or bad
(negative) for our business.
- name: rel_diff_with_sign_current_ytd_vs_ytd_target
data_type: numeric
description: |
Relative difference between the current year YTD and the YTD target,
with a sign to represent if the relative difference is good (positive) or bad
(negative) for our business.

View file

@ -3,8 +3,7 @@ with
select * from {{ ref("int_ytd_mtd_aggregated_main_metrics_overview") }}
),
latest_dates_per_financial_year as (
select
dimension, financial_year, id_metric, max(m.date) as latest_available_date
select dimension, financial_year, id_metric, max(date) as latest_available_date
from int_ytd_mtd_aggregated_main_metrics_overview m
where
(
@ -64,17 +63,7 @@ select
m.target_eofy_value as target_eofy_value,
m.diff_current_ytd_vs_eofy_target as diff_current_ytd_vs_eofy_target,
m.achievement_rate_current_ytd_vs_eofy_target
as achievement_rate_current_ytd_vs_eofy_target,
m.rel_diff_with_sign_current_month_mtd_vs_previous_month_eom
as rel_diff_with_sign_current_month_mtd_vs_previous_month_eom,
m.rel_diff_with_sign_current_month_mtd_vs_previous_year_mtd
as rel_diff_with_sign_current_month_mtd_vs_previous_year_mtd,
m.rel_diff_with_sign_current_ytd_vs_previous_ytd
as rel_diff_with_sign_current_ytd_vs_previous_ytd,
m.rel_diff_with_sign_current_month_mtd_vs_eom_target
as rel_diff_with_sign_current_month_mtd_vs_eom_target,
m.rel_diff_with_sign_current_ytd_vs_ytd_target
as rel_diff_with_sign_current_ytd_vs_ytd_target
as achievement_rate_current_ytd_vs_eofy_target
from int_ytd_mtd_aggregated_main_metrics_overview m
inner join
latest_dates_per_financial_year ld