Merged PR 4833: Added current deal lifecycle to new dash overview

# Description

Added current deal lifecycle to new dash overview

# 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.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Added current deal lifecycle to new dash overview

Related work items: #28873
This commit is contained in:
Joaquin Ossa 2025-03-28 08:20:58 +00:00
commit e4fb1af349
5 changed files with 50 additions and 1 deletions

View file

@ -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,