Merged PR 3171: Improvements on monthly growth score by deal

# Description

Main changes:
* Includes 4 new fields to take into account 12 month created bookings. Specifically:
            `deal_created_bookings_12_months_window`
            `global_created_bookings_12_months_window`
            `deal_contribution_share_to_global_created_bookings`
            `deal_contribution_rank_to_global_created_bookings`
This also renames a CTE, that was previously stating it was revenue. Same for inline comments. Also includes documentation of this fields.
* Score range modification: Now, growth scores are multiplied by 100 and weighted score by 1000. This makes it easier to display and understand (Growth cannot be less than -100, threshold value is now -1, 0 and 1).

I checked that the content already in production has not change (ex: we still have the same 15 top losers for September).

# 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.
- [NA] I have checked for DRY opportunities with other models and docs.
- [NA] 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: #22635
This commit is contained in:
Oriol Roqué Paniagua 2024-10-15 12:31:39 +00:00
parent 9440e6d624
commit 61339a7d58
4 changed files with 168 additions and 25 deletions

View file

@ -962,8 +962,62 @@ models:
data_type: integer
description: |
Represents the ordered list of deals by descending size
in terms of revenue. It cannot be null. If more than one
deal have the same share, the order is not under control.
in terms of revenue.
If more than one deal have the same share, the order is
not under control.
It cannot be null.
tests:
- not_null
- name: deal_created_bookings_12_months_window
data_type: integer
description: |
Total created bookings generated by a deal
in the months from the period ranging from the
aggregated_revenue_from_first_day_month to
aggregated_revenue_to_first_day_month.
It cannot be null.
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
- name: global_created_bookings_12_months_window
data_type: integer
description: |
Total created bookings generated by a deal
in the months from the period ranging from the
aggregated_revenue_from_first_day_month to
aggregated_revenue_to_first_day_month.
It is used for the deal contribution share with respect
to the global created bookings. It cannot be null.
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
- name: deal_contribution_share_to_global_created_bookings
data_type: decimal
description: |
Represents the size of the deal in terms of created bookings.
In other words, what's the percentage of the global created
bookings that can be attributed to this deal.
It cannot be null.
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0
strictly: false
- name: deal_contribution_rank_to_global_created_bookings
data_type: integer
description: |
Represents the ordered list of deals by descending size
in terms of created bookings.
If more than one deal have the same share, the order is
not under control.
It cannot be null.
tests:
- not_null