Merged PR 4471: Visualisation changes

# Description

Adapts YTD/MTD for visualisation purposes

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

Visualisation changes

Related work items: #27609
This commit is contained in:
Oriol Roqué Paniagua 2025-02-20 18:43:26 +00:00
parent 5942e4b81c
commit 8cf7393173
3 changed files with 27 additions and 0 deletions

View file

@ -1968,6 +1968,12 @@ models:
data_tests:
- not_null
- name: first_day_month
data_type: date
description: The first day of the month associated with the data.
data_tests:
- not_null
- name: calendar_year
data_type: integer
description: The calendar year associated with the data.

View file

@ -25,6 +25,7 @@ select
m.calendar_year as calendar_year,
m.financial_year as financial_year,
m.date as date,
date_trunc('month', m.date)::date as first_day_month,
case when m.date = ld.latest_available_date then 1 else 0 end as is_latest_date,
m.previous_year_date as previous_year_date,
m.dimension as dimension,