commit wip
This commit is contained in:
parent
bf1e125856
commit
1ced79ca0a
2 changed files with 9 additions and 17 deletions
|
|
@ -44,18 +44,14 @@ with
|
||||||
case
|
case
|
||||||
when upper(hd.deal_pipeline) in ('API SALES') then 'API' else 'PLATFORM'
|
when upper(hd.deal_pipeline) in ('API SALES') then 'API' else 'PLATFORM'
|
||||||
end as client_type,
|
end as client_type,
|
||||||
min(
|
hd.deal_start_date as effective_deal_start_date_utc,
|
||||||
coalesce(hd.deal_start_date, cd.deal_start_date)
|
hd.deal_start_month as effective_deal_start_month,
|
||||||
) as effective_deal_start_date_utc,
|
|
||||||
min(
|
|
||||||
coalesce(hd.deal_start_month, cd.deal_start_month)
|
|
||||||
) as effective_deal_start_month,
|
|
||||||
min(hd.deal_cancellation_date) as hubspot_deal_cancellation_date_utc,
|
min(hd.deal_cancellation_date) as hubspot_deal_cancellation_date_utc,
|
||||||
min(hd.deal_cancellation_month) as hubspot_deal_cancellation_month,
|
min(hd.deal_cancellation_month) as hubspot_deal_cancellation_month,
|
||||||
min(hd.hubspot_listing_segmentation) as hubspot_listing_segmentation
|
min(hd.hubspot_listing_segmentation) as hubspot_listing_segmentation
|
||||||
from hubspot_deals hd
|
from hubspot_deals hd
|
||||||
full outer join core_deals cd on hd.id_deal = cd.id_deal
|
full outer join core_deals cd on hd.id_deal = cd.id_deal
|
||||||
group by 1, 2, 3, 4, 5, 6
|
group by 1, 2, 3, 4, 5, 6, 7, 8
|
||||||
)
|
)
|
||||||
select
|
select
|
||||||
cd.id_deal,
|
cd.id_deal,
|
||||||
|
|
|
||||||
|
|
@ -479,19 +479,15 @@ models:
|
||||||
- name: effective_deal_start_date_utc
|
- name: effective_deal_start_date_utc
|
||||||
data_type: date
|
data_type: date
|
||||||
description: |
|
description: |
|
||||||
Effective start date of the deal, which corresponds to the minimum between the
|
Effective start date of the deal, this corresponds to the date a deal has
|
||||||
date a deal has gone live according to Hubspot and the first date a user
|
gone live according to Hubspot.
|
||||||
host has been created according to Core.
|
It can be Null if the deal doesn't appear in HubSpot.
|
||||||
data_tests:
|
|
||||||
- not_null
|
|
||||||
- name: effective_deal_start_month
|
- name: effective_deal_start_month
|
||||||
data_type: date
|
data_type: date
|
||||||
description: |
|
description: |
|
||||||
This field represents the first day of the month of the effective
|
This field represents the first day of the month of the effective deal
|
||||||
start date of the deal. This is obtained by truncating the effective
|
start date. This is obtained by truncating the effective deal start date
|
||||||
deal start date to the month.
|
to the month.
|
||||||
data_tests:
|
|
||||||
- not_null
|
|
||||||
- name: hubspot_deal_cancellation_date_utc
|
- name: hubspot_deal_cancellation_date_utc
|
||||||
data_type: date
|
data_type: date
|
||||||
description: |
|
description: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue