Addressed comments

This commit is contained in:
Joaquin Ossa 2024-11-11 16:22:13 +01:00
parent eec21fe5da
commit 88083fc846
3 changed files with 12 additions and 5 deletions

View file

@ -1,5 +1,3 @@
{% set starting_date = "('2020-01-01')" %}
with
unique_dimensions as (
select distinct has_payment, has_id_check
@ -8,4 +6,4 @@ with
select d.date_day, ud.has_payment, ud.has_id_check
from {{ ref("int_dates") }} as d
cross join unique_dimensions as ud
where d.date_day >= {{ starting_date }}
where d.date_day >= {{ var("start_date") }}

View file

@ -72,6 +72,7 @@ with
select
gk.date_day,
gk_py.date_day as py_date_day,
gk.has_payment,
gk.has_id_check,
sum(
@ -130,4 +131,4 @@ left join
and gk.has_id_check = gk_py.has_id_check
-- Here we use a group by because of leap days that generate duplicity when being
-- moved to another year
group by gk.date_day, gk.has_payment, gk.has_id_check
group by gk.date_day, gk_py.date_day, gk.has_payment, gk.has_id_check

View file

@ -5829,7 +5829,8 @@ models:
The unique key corresponds to the deepest granularity of the model,
in this case:
- date_day,
- date_day,
- py_date_day,
- id_deal,
- has_id_check.
@ -5837,6 +5838,7 @@ models:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date_day
- py_date_day
- has_payment
- has_id_check
columns:
@ -5846,6 +5848,12 @@ models:
tests:
- not_null
- name: py_date_day
data_type: date
description: |
Date on the previous year of when Guest Journeys have been completed.
Note that this date can be NULL for leap days (29th February)
- name: has_payment
data_type: string
description: Has there been any guest payments on the guest journey.