Merged PR 5238: Brings additional sales info from hubspot
# Description Brings additional info from Hubspot Deals regarding onboarding process # 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. Related work items: #30249
This commit is contained in:
parent
ca3fc4add9
commit
43a20a3c22
6 changed files with 114 additions and 1 deletions
|
|
@ -1,7 +1,11 @@
|
|||
{% set id_deal_pipelines_excluded = "('15380854')" %}
|
||||
{% set generic_account_manager_names = "('Host Services')" %}
|
||||
|
||||
with
|
||||
stg_hubspot__deals as (select * from {{ ref("stg_hubspot__deals") }}),
|
||||
stg_seed__hubspot_account_owner as (
|
||||
select * from {{ ref("stg_seed__hubspot_account_owner") }}
|
||||
),
|
||||
stg_hubspot__deal_pipeline_stages as (
|
||||
select * from {{ ref("stg_hubspot__deal_pipeline_stages") }}
|
||||
),
|
||||
|
|
@ -16,6 +20,15 @@ select
|
|||
d.live_date_utc,
|
||||
d.cancellation_date_utc,
|
||||
d.account_manager,
|
||||
case
|
||||
when d.onboarding_owner is not null
|
||||
then onboarding_owner
|
||||
when
|
||||
d.onboarding_owner is null
|
||||
and d.account_manager in {{ generic_account_manager_names }}
|
||||
then hao.hubspot_account_owner
|
||||
else null
|
||||
end as onboarding_owner,
|
||||
dp.deal_pipeline_name as deal_pipeline,
|
||||
dps.stage_name as deal_hubspot_stage,
|
||||
d.cancellation_category,
|
||||
|
|
@ -27,6 +40,7 @@ select
|
|||
d.dashboard_type,
|
||||
d.pricing_structure,
|
||||
d.partnership_services,
|
||||
d.expressed_service_interest,
|
||||
d.created_at_utc,
|
||||
d.created_date_utc,
|
||||
d.updated_at_utc,
|
||||
|
|
@ -34,5 +48,8 @@ select
|
|||
from stg_hubspot__deals d
|
||||
left join stg_hubspot__deal_pipeline_stages dps on d.id_deal_stage = dps.id_stage
|
||||
left join stg_hubspot__deal_pipelines dp on dps.id_deal_pipeline = dp.id_deal_pipeline
|
||||
left join
|
||||
stg_seed__hubspot_account_owner hao
|
||||
on d.id_hubspot_account_owner = hao.id_hubspot_account_owner
|
||||
-- Exclude Guardhog pipelines
|
||||
where dps.id_deal_pipeline not in {{ id_deal_pipelines_excluded }}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,12 @@ models:
|
|||
The name of the account manager that is currently taking care of this
|
||||
deal.
|
||||
|
||||
- name: onboarding_owner
|
||||
data_type: text
|
||||
description: |
|
||||
The name of the person who is or has been in charge of onboarding this
|
||||
deal.
|
||||
|
||||
- name: deal_pipeline
|
||||
data_type: text
|
||||
description: |
|
||||
|
|
@ -111,6 +117,18 @@ models:
|
|||
for complete accuracy.
|
||||
It can be null.
|
||||
|
||||
- name: expressed_service_interest
|
||||
data_type: text
|
||||
description: |
|
||||
The services that captured the interest of the potential client
|
||||
during onboarding calls, for New Dash.
|
||||
This field has been processed by applying a standardized separation
|
||||
"|" and an upper case. Be aware that this is not how data is
|
||||
presented in HubSpot.
|
||||
Not to be confused with the actual services that host has applied.
|
||||
For the later, check backend data.
|
||||
It can be null.
|
||||
|
||||
- name: created_at_utc
|
||||
data_type: timestamp with time zone
|
||||
description: Timestamp of when the record was created in Hubspot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue