Addressed comments
This commit is contained in:
parent
eec21fe5da
commit
88083fc846
3 changed files with 12 additions and 5 deletions
|
|
@ -1,5 +1,3 @@
|
||||||
{% set starting_date = "('2020-01-01')" %}
|
|
||||||
|
|
||||||
with
|
with
|
||||||
unique_dimensions as (
|
unique_dimensions as (
|
||||||
select distinct has_payment, has_id_check
|
select distinct has_payment, has_id_check
|
||||||
|
|
@ -8,4 +6,4 @@ with
|
||||||
select d.date_day, ud.has_payment, ud.has_id_check
|
select d.date_day, ud.has_payment, ud.has_id_check
|
||||||
from {{ ref("int_dates") }} as d
|
from {{ ref("int_dates") }} as d
|
||||||
cross join unique_dimensions as ud
|
cross join unique_dimensions as ud
|
||||||
where d.date_day >= {{ starting_date }}
|
where d.date_day >= {{ var("start_date") }}
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ with
|
||||||
|
|
||||||
select
|
select
|
||||||
gk.date_day,
|
gk.date_day,
|
||||||
|
gk_py.date_day as py_date_day,
|
||||||
gk.has_payment,
|
gk.has_payment,
|
||||||
gk.has_id_check,
|
gk.has_id_check,
|
||||||
sum(
|
sum(
|
||||||
|
|
@ -130,4 +131,4 @@ left join
|
||||||
and gk.has_id_check = gk_py.has_id_check
|
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
|
-- Here we use a group by because of leap days that generate duplicity when being
|
||||||
-- moved to another year
|
-- 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
|
||||||
|
|
|
||||||
|
|
@ -5830,6 +5830,7 @@ models:
|
||||||
The unique key corresponds to the deepest granularity of the model,
|
The unique key corresponds to the deepest granularity of the model,
|
||||||
in this case:
|
in this case:
|
||||||
- date_day,
|
- date_day,
|
||||||
|
- py_date_day,
|
||||||
- id_deal,
|
- id_deal,
|
||||||
- has_id_check.
|
- has_id_check.
|
||||||
|
|
||||||
|
|
@ -5837,6 +5838,7 @@ models:
|
||||||
- dbt_utils.unique_combination_of_columns:
|
- dbt_utils.unique_combination_of_columns:
|
||||||
combination_of_columns:
|
combination_of_columns:
|
||||||
- date_day
|
- date_day
|
||||||
|
- py_date_day
|
||||||
- has_payment
|
- has_payment
|
||||||
- has_id_check
|
- has_id_check
|
||||||
columns:
|
columns:
|
||||||
|
|
@ -5846,6 +5848,12 @@ models:
|
||||||
tests:
|
tests:
|
||||||
- not_null
|
- 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
|
- name: has_payment
|
||||||
data_type: string
|
data_type: string
|
||||||
description: Has there been any guest payments on the guest journey.
|
description: Has there been any guest payments on the guest journey.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue