Merged PR 4483: Adding targets (to be revised). Allows multi-year last-date computation

# Description

Changes:
* Adds template for targets -> These need to be revised
* Adds comparison of values vs. targets
* Allows for multi-year last date computation (allowing multiple years to be selected, not just the last one)

# 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: #27609, #27805
This commit is contained in:
Oriol Roqué Paniagua 2025-02-24 10:39:45 +00:00
parent cbed87404e
commit 85c2c73da7
6 changed files with 332 additions and 40 deletions

View file

@ -319,3 +319,57 @@ seeds:
- 214-Basic Damage Deposit
- 215-Resolution Process for Deposit Management Services
- 511-Damage Host-Waiver Payments
- name: stg_seed__main_metrics_targets
description: |
A list of financial year targets for the main metrics that we track in the company.
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- id_metric
- target_date
columns:
- name: id_metric
data_type: bigint
description: The id of the metric used for joining with other tables.
data_tests:
- not_null
- name: metric_name
data_type: character varying
description: The name of the metric for human consumption
data_tests:
- not_null
- name: target_date
data_type: date
description: |
The date when this target is expected to be achieved.
data_tests:
- not_null
- name: target_eom_value
data_type: numeric
description: |
The EOM target value for this metric. This is the value that we aim to
achieve by the end of the month.
data_tests:
- not_null
- name: target_ytd_value
data_type: numeric
description: |
The YTD target value for this metric. This is the cummulative value that we
aim to achieve by the end of each month with respect to the beginning of the
financial year, that will put us to reach the EOFY target.
data_tests:
- not_null
- name: target_eofy_value
data_type: numeric
description: |
The EOFY target value for this metric. This is the value that we aim to
achieve by the end of the financial year.
data_tests:
- not_null