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:
Oriol Roqué Paniagua 2025-03-05 13:02:07 +00:00
parent 1a4a9fac37
commit 5d6e860e2b
8 changed files with 80 additions and 0 deletions

View file

@ -79,6 +79,7 @@ select
d.date,
-- DEAL STATIC ATTRIBUTES --
ikdd.id_deal,
ikdd.client_type,
ikdd.main_deal_name,
ikdd.has_active_pms,
ikdd.active_pms_list,

View file

@ -8,6 +8,7 @@ with
select
date,
id_deal,
client_type,
main_deal_name,
has_active_pms,
active_pms_list,
@ -121,6 +122,7 @@ with
select
date,
id_deal,
client_type,
main_deal_name,
has_active_pms,
active_pms_list,
@ -219,6 +221,7 @@ with
select
date,
id_deal,
client_type,
main_deal_name,
has_active_pms,
active_pms_list,
@ -317,6 +320,7 @@ with
select
date,
id_deal,
client_type,
main_deal_name,
has_active_pms,
active_pms_list,
@ -415,6 +419,7 @@ with
select
date,
id_deal,
client_type,
main_deal_name,
has_active_pms,
active_pms_list,
@ -536,6 +541,7 @@ select
mabd.max_date as metric_to_date,
-- Deal attributes
mabd.client_type,
mabd.main_deal_name,
mabd.has_active_pms,
mabd.active_pms_list,

View file

@ -11,6 +11,7 @@ with
date,
date_trunc('month', date)::date as first_day_month,
id_deal,
client_type,
main_deal_name,
has_active_pms,
active_pms_list,
@ -92,6 +93,7 @@ with
given_month.id_deal,
-- Deal Attributes
given_month.client_type,
given_month.main_deal_name,
given_month.has_active_pms,
given_month.active_pms_list,
@ -245,6 +247,7 @@ with
m.date,
m.id_deal,
m.client_type,
m.main_deal_name,
m.has_active_pms,
m.active_pms_list,
@ -351,6 +354,7 @@ select
gsc.date,
gsc.id_deal,
gsc.client_type,
gsc.main_deal_name,
gsc.has_active_pms,
gsc.active_pms_list,

View file

@ -354,6 +354,17 @@ models:
data_tests:
- 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
data_type: string
description: |
@ -441,6 +452,17 @@ models:
data_tests:
- 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
data_type: string
description: |
@ -1499,6 +1521,17 @@ models:
- Previous 3 months
- 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
data_type: date
description: |