Added boolean
This commit is contained in:
parent
3833f3e92d
commit
b138e0c626
2 changed files with 5 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ with
|
|||
select *
|
||||
from {{ ref("int_kpis__lifecycle_daily_deal") }}
|
||||
-- Only retrieve deals lifecycle from yesterday
|
||||
where date = current_date - 1
|
||||
where is_current_state = true
|
||||
),
|
||||
upb_aggregation as (
|
||||
select
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ with
|
|||
deal_historic_booking_dates as (
|
||||
select
|
||||
d.date,
|
||||
d.is_yesterday,
|
||||
ikdd.id_deal,
|
||||
ikdd.is_deal_in_hubspot,
|
||||
min(ikdd.client_type) as client_type,
|
||||
|
|
@ -66,11 +67,12 @@ with
|
|||
booked_days_per_deal b
|
||||
on ikdd.id_deal = b.id_deal
|
||||
and d.date >= b.created_date_utc
|
||||
group by d.date, ikdd.id_deal, ikdd.is_deal_in_hubspot
|
||||
group by d.date, d.is_yesterday, ikdd.id_deal, ikdd.is_deal_in_hubspot
|
||||
),
|
||||
deal_historic_features as (
|
||||
select
|
||||
hhbf.date,
|
||||
case when hhbf.is_yesterday then true else false end as is_current_state,
|
||||
hhbf.id_deal,
|
||||
hhbf.is_deal_in_hubspot,
|
||||
hhbf.creation_date_utc,
|
||||
|
|
@ -151,6 +153,7 @@ with
|
|||
)
|
||||
select
|
||||
date,
|
||||
is_current_state,
|
||||
id_deal,
|
||||
creation_date_utc,
|
||||
first_time_booked_date_utc,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue