Merged PR 4596: Propagates Client Type to KPIs by Deal and AM models
# Description Propagates Client Type to KPIs by Deal and AM models. This is just a distinction between Platform and APIs. # 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. - [X] I have checked for DRY opportunities with other models and docs. - [X] 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: #28181
This commit is contained in:
parent
1a4a9fac37
commit
5d6e860e2b
8 changed files with 80 additions and 0 deletions
|
|
@ -79,6 +79,7 @@ select
|
||||||
d.date,
|
d.date,
|
||||||
-- DEAL STATIC ATTRIBUTES --
|
-- DEAL STATIC ATTRIBUTES --
|
||||||
ikdd.id_deal,
|
ikdd.id_deal,
|
||||||
|
ikdd.client_type,
|
||||||
ikdd.main_deal_name,
|
ikdd.main_deal_name,
|
||||||
ikdd.has_active_pms,
|
ikdd.has_active_pms,
|
||||||
ikdd.active_pms_list,
|
ikdd.active_pms_list,
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ with
|
||||||
select
|
select
|
||||||
date,
|
date,
|
||||||
id_deal,
|
id_deal,
|
||||||
|
client_type,
|
||||||
main_deal_name,
|
main_deal_name,
|
||||||
has_active_pms,
|
has_active_pms,
|
||||||
active_pms_list,
|
active_pms_list,
|
||||||
|
|
@ -121,6 +122,7 @@ with
|
||||||
select
|
select
|
||||||
date,
|
date,
|
||||||
id_deal,
|
id_deal,
|
||||||
|
client_type,
|
||||||
main_deal_name,
|
main_deal_name,
|
||||||
has_active_pms,
|
has_active_pms,
|
||||||
active_pms_list,
|
active_pms_list,
|
||||||
|
|
@ -219,6 +221,7 @@ with
|
||||||
select
|
select
|
||||||
date,
|
date,
|
||||||
id_deal,
|
id_deal,
|
||||||
|
client_type,
|
||||||
main_deal_name,
|
main_deal_name,
|
||||||
has_active_pms,
|
has_active_pms,
|
||||||
active_pms_list,
|
active_pms_list,
|
||||||
|
|
@ -317,6 +320,7 @@ with
|
||||||
select
|
select
|
||||||
date,
|
date,
|
||||||
id_deal,
|
id_deal,
|
||||||
|
client_type,
|
||||||
main_deal_name,
|
main_deal_name,
|
||||||
has_active_pms,
|
has_active_pms,
|
||||||
active_pms_list,
|
active_pms_list,
|
||||||
|
|
@ -415,6 +419,7 @@ with
|
||||||
select
|
select
|
||||||
date,
|
date,
|
||||||
id_deal,
|
id_deal,
|
||||||
|
client_type,
|
||||||
main_deal_name,
|
main_deal_name,
|
||||||
has_active_pms,
|
has_active_pms,
|
||||||
active_pms_list,
|
active_pms_list,
|
||||||
|
|
@ -536,6 +541,7 @@ select
|
||||||
mabd.max_date as metric_to_date,
|
mabd.max_date as metric_to_date,
|
||||||
|
|
||||||
-- Deal attributes
|
-- Deal attributes
|
||||||
|
mabd.client_type,
|
||||||
mabd.main_deal_name,
|
mabd.main_deal_name,
|
||||||
mabd.has_active_pms,
|
mabd.has_active_pms,
|
||||||
mabd.active_pms_list,
|
mabd.active_pms_list,
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ with
|
||||||
date,
|
date,
|
||||||
date_trunc('month', date)::date as first_day_month,
|
date_trunc('month', date)::date as first_day_month,
|
||||||
id_deal,
|
id_deal,
|
||||||
|
client_type,
|
||||||
main_deal_name,
|
main_deal_name,
|
||||||
has_active_pms,
|
has_active_pms,
|
||||||
active_pms_list,
|
active_pms_list,
|
||||||
|
|
@ -92,6 +93,7 @@ with
|
||||||
given_month.id_deal,
|
given_month.id_deal,
|
||||||
|
|
||||||
-- Deal Attributes
|
-- Deal Attributes
|
||||||
|
given_month.client_type,
|
||||||
given_month.main_deal_name,
|
given_month.main_deal_name,
|
||||||
given_month.has_active_pms,
|
given_month.has_active_pms,
|
||||||
given_month.active_pms_list,
|
given_month.active_pms_list,
|
||||||
|
|
@ -245,6 +247,7 @@ with
|
||||||
m.date,
|
m.date,
|
||||||
m.id_deal,
|
m.id_deal,
|
||||||
|
|
||||||
|
m.client_type,
|
||||||
m.main_deal_name,
|
m.main_deal_name,
|
||||||
m.has_active_pms,
|
m.has_active_pms,
|
||||||
m.active_pms_list,
|
m.active_pms_list,
|
||||||
|
|
@ -351,6 +354,7 @@ select
|
||||||
gsc.date,
|
gsc.date,
|
||||||
gsc.id_deal,
|
gsc.id_deal,
|
||||||
|
|
||||||
|
gsc.client_type,
|
||||||
gsc.main_deal_name,
|
gsc.main_deal_name,
|
||||||
gsc.has_active_pms,
|
gsc.has_active_pms,
|
||||||
gsc.active_pms_list,
|
gsc.active_pms_list,
|
||||||
|
|
|
||||||
|
|
@ -354,6 +354,17 @@ models:
|
||||||
data_tests:
|
data_tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
|
- name: client_type
|
||||||
|
data_type: string
|
||||||
|
description: |
|
||||||
|
Type of client. It can be either PLATFORM or API.
|
||||||
|
data_tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- PLATFORM
|
||||||
|
- API
|
||||||
|
|
||||||
- name: main_deal_name
|
- name: main_deal_name
|
||||||
data_type: string
|
data_type: string
|
||||||
description: |
|
description: |
|
||||||
|
|
@ -441,6 +452,17 @@ models:
|
||||||
data_tests:
|
data_tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
|
- name: client_type
|
||||||
|
data_type: string
|
||||||
|
description: |
|
||||||
|
Type of client. It can be either PLATFORM or API.
|
||||||
|
data_tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- PLATFORM
|
||||||
|
- API
|
||||||
|
|
||||||
- name: main_deal_name
|
- name: main_deal_name
|
||||||
data_type: string
|
data_type: string
|
||||||
description: |
|
description: |
|
||||||
|
|
@ -1499,6 +1521,17 @@ models:
|
||||||
- Previous 3 months
|
- Previous 3 months
|
||||||
- Previous month
|
- Previous month
|
||||||
|
|
||||||
|
- name: client_type
|
||||||
|
data_type: string
|
||||||
|
description: |
|
||||||
|
Type of client. It can be either PLATFORM or API.
|
||||||
|
data_tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- PLATFORM
|
||||||
|
- API
|
||||||
|
|
||||||
- name: metric_from_date
|
- name: metric_from_date
|
||||||
data_type: date
|
data_type: date
|
||||||
description: |
|
description: |
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ select
|
||||||
day as day,
|
day as day,
|
||||||
date as date,
|
date as date,
|
||||||
id_deal as id_deal,
|
id_deal as id_deal,
|
||||||
|
client_type as client_type,
|
||||||
main_deal_name as main_deal_name,
|
main_deal_name as main_deal_name,
|
||||||
main_billing_country_iso_3_per_deal as main_billing_country_iso_3_per_deal,
|
main_billing_country_iso_3_per_deal as main_billing_country_iso_3_per_deal,
|
||||||
deal_lifecycle_state as deal_lifecycle_state,
|
deal_lifecycle_state as deal_lifecycle_state,
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ select
|
||||||
metric_to_date as metric_to_date,
|
metric_to_date as metric_to_date,
|
||||||
main_deal_name as main_deal_name,
|
main_deal_name as main_deal_name,
|
||||||
has_active_pms as has_active_pms,
|
has_active_pms as has_active_pms,
|
||||||
|
client_type as client_type,
|
||||||
active_pms_list as active_pms_list,
|
active_pms_list as active_pms_list,
|
||||||
main_billing_country_iso_3_per_deal as main_billing_country_iso_3_per_deal,
|
main_billing_country_iso_3_per_deal as main_billing_country_iso_3_per_deal,
|
||||||
deal_lifecycle_state as deal_lifecycle_state,
|
deal_lifecycle_state as deal_lifecycle_state,
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ select
|
||||||
date as date,
|
date as date,
|
||||||
id_deal as id_deal,
|
id_deal as id_deal,
|
||||||
|
|
||||||
|
client_type as client_type,
|
||||||
main_deal_name as main_deal_name,
|
main_deal_name as main_deal_name,
|
||||||
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,
|
||||||
|
|
|
||||||
|
|
@ -494,6 +494,17 @@ models:
|
||||||
data_tests:
|
data_tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
|
- name: client_type
|
||||||
|
data_type: string
|
||||||
|
description: |
|
||||||
|
Type of client. It can be either PLATFORM or API.
|
||||||
|
data_tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- PLATFORM
|
||||||
|
- API
|
||||||
|
|
||||||
- name: main_deal_name
|
- name: main_deal_name
|
||||||
data_type: string
|
data_type: string
|
||||||
description: |
|
description: |
|
||||||
|
|
@ -630,6 +641,17 @@ models:
|
||||||
data_tests:
|
data_tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
|
- name: client_type
|
||||||
|
data_type: string
|
||||||
|
description: |
|
||||||
|
Type of client. It can be either PLATFORM or API.
|
||||||
|
data_tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- PLATFORM
|
||||||
|
- API
|
||||||
|
|
||||||
- name: main_deal_name
|
- name: main_deal_name
|
||||||
data_type: string
|
data_type: string
|
||||||
description: |
|
description: |
|
||||||
|
|
@ -1477,6 +1499,17 @@ models:
|
||||||
- Previous 3 months
|
- Previous 3 months
|
||||||
- Previous month
|
- Previous month
|
||||||
|
|
||||||
|
- name: client_type
|
||||||
|
data_type: string
|
||||||
|
description: |
|
||||||
|
Type of client. It can be either PLATFORM or API.
|
||||||
|
data_tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- PLATFORM
|
||||||
|
- API
|
||||||
|
|
||||||
- name: metric_from_date
|
- name: metric_from_date
|
||||||
data_type: date
|
data_type: date
|
||||||
description: |
|
description: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue