Added current deal lifecycle to new dash overview
This commit is contained in:
parent
8c3a32d62e
commit
3833f3e92d
4 changed files with 46 additions and 0 deletions
|
|
@ -10,6 +10,12 @@ with
|
||||||
int_core__accommodation_to_product_bundle as (
|
int_core__accommodation_to_product_bundle as (
|
||||||
select * from {{ ref("int_core__accommodation_to_product_bundle") }}
|
select * from {{ ref("int_core__accommodation_to_product_bundle") }}
|
||||||
),
|
),
|
||||||
|
int_kpis__lifecycle_daily_deal as (
|
||||||
|
select *
|
||||||
|
from {{ ref("int_kpis__lifecycle_daily_deal") }}
|
||||||
|
-- Only retrieve deals lifecycle from yesterday
|
||||||
|
where date = current_date - 1
|
||||||
|
),
|
||||||
upb_aggregation as (
|
upb_aggregation as (
|
||||||
select
|
select
|
||||||
upb.id_user_host,
|
upb.id_user_host,
|
||||||
|
|
@ -89,6 +95,7 @@ with
|
||||||
uh.has_user_moved_from_old_dash,
|
uh.has_user_moved_from_old_dash,
|
||||||
uh.new_dash_version as user_migration_phase,
|
uh.new_dash_version as user_migration_phase,
|
||||||
uh.user_in_new_dash_since_date_utc as user_estimated_migration_date_utc,
|
uh.user_in_new_dash_since_date_utc as user_estimated_migration_date_utc,
|
||||||
|
kldd.deal_lifecycle_state,
|
||||||
uh.has_active_pms,
|
uh.has_active_pms,
|
||||||
uh.active_pms_list,
|
uh.active_pms_list,
|
||||||
uh.company_name,
|
uh.company_name,
|
||||||
|
|
@ -112,6 +119,7 @@ with
|
||||||
int_core__user_host uh
|
int_core__user_host uh
|
||||||
on upb.id_user_host = uh.id_user_host
|
on upb.id_user_host = uh.id_user_host
|
||||||
and uh.is_test_account = false
|
and uh.is_test_account = false
|
||||||
|
left join int_kpis__lifecycle_daily_deal kldd on uh.id_deal = kldd.id_deal
|
||||||
)
|
)
|
||||||
select
|
select
|
||||||
id_user_host,
|
id_user_host,
|
||||||
|
|
@ -119,6 +127,7 @@ select
|
||||||
has_user_moved_from_old_dash,
|
has_user_moved_from_old_dash,
|
||||||
user_migration_phase,
|
user_migration_phase,
|
||||||
user_estimated_migration_date_utc,
|
user_estimated_migration_date_utc,
|
||||||
|
deal_lifecycle_state,
|
||||||
has_active_pms,
|
has_active_pms,
|
||||||
active_pms_list,
|
active_pms_list,
|
||||||
company_name,
|
company_name,
|
||||||
|
|
|
||||||
|
|
@ -2559,6 +2559,24 @@ models:
|
||||||
data_tests:
|
data_tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
|
- name: deal_lifecycle_state
|
||||||
|
data_type: character varying
|
||||||
|
description: |
|
||||||
|
Contains the lifecycle state of a deal. The accepted values are:
|
||||||
|
01-New, 02-Never Booked, 04-Active, 05-Churning, 06-Inactive,
|
||||||
|
07-Reactivated, 99-Not in Husbpot.
|
||||||
|
data_tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- 01-New
|
||||||
|
- 02-Never Booked
|
||||||
|
- 04-Active
|
||||||
|
- 05-Churning
|
||||||
|
- 06-Inactive
|
||||||
|
- 07-Reactivated
|
||||||
|
- 99-Not in HubSpot
|
||||||
|
|
||||||
- name: has_active_pms
|
- name: has_active_pms
|
||||||
data_type: boolean
|
data_type: boolean
|
||||||
description: |
|
description: |
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ select
|
||||||
has_user_moved_from_old_dash as has_user_moved_from_old_dash,
|
has_user_moved_from_old_dash as has_user_moved_from_old_dash,
|
||||||
user_migration_phase as user_migration_phase,
|
user_migration_phase as user_migration_phase,
|
||||||
user_estimated_migration_date_utc as user_estimated_migration_date_utc,
|
user_estimated_migration_date_utc as user_estimated_migration_date_utc,
|
||||||
|
deal_lifecycle_state as deal_lifecycle_state,
|
||||||
has_active_pms as has_active_pms,
|
has_active_pms as has_active_pms,
|
||||||
active_pms_list as active_pms_list,
|
active_pms_list as active_pms_list,
|
||||||
company_name as company_name,
|
company_name as company_name,
|
||||||
|
|
|
||||||
|
|
@ -1158,6 +1158,24 @@ models:
|
||||||
data_tests:
|
data_tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
|
- name: deal_lifecycle_state
|
||||||
|
data_type: character varying
|
||||||
|
description: |
|
||||||
|
Contains the lifecycle state of a deal. The accepted values are:
|
||||||
|
01-New, 02-Never Booked, 04-Active, 05-Churning, 06-Inactive,
|
||||||
|
07-Reactivated, 99-Not in Husbpot.
|
||||||
|
data_tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- 01-New
|
||||||
|
- 02-Never Booked
|
||||||
|
- 04-Active
|
||||||
|
- 05-Churning
|
||||||
|
- 06-Inactive
|
||||||
|
- 07-Reactivated
|
||||||
|
- 99-Not in HubSpot
|
||||||
|
|
||||||
- name: has_active_pms
|
- name: has_active_pms
|
||||||
data_type: boolean
|
data_type: boolean
|
||||||
description: |
|
description: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue