Merged PR 4948: Reporting model for mtd aggregated metrics by deal
# Description Creates a new model for reporting. It includes any relevant metric at Deal level in a similar format as we do for `mtd_aggregated_metrics`. Additionally, there's few Deal attributes - from Hubspot, segmentations, lifecycles, etc. In order to dynamically choose which metrics are relevant on a Deal level, I modified the configuration in `int_mtd_aggregated_metrics` so the extraction is under control. # 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. **Worth discussing the possibilities to include indexes in the future** # Other - [ ] Check if a full-refresh is required after this PR is merged. Related work items: #28998
This commit is contained in:
parent
ca5db795a3
commit
a67e3f46ba
5 changed files with 558 additions and 1 deletions
|
|
@ -8,6 +8,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 2,
|
||||
|
|
@ -18,6 +19,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 3,
|
||||
|
|
@ -28,6 +30,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 4,
|
||||
|
|
@ -38,6 +41,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 5,
|
||||
|
|
@ -48,6 +52,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 6,
|
||||
|
|
@ -58,6 +63,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 7,
|
||||
|
|
@ -68,6 +74,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 8,
|
||||
|
|
@ -78,6 +85,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 10,
|
||||
|
|
@ -88,6 +96,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 11,
|
||||
|
|
@ -98,6 +107,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 12,
|
||||
|
|
@ -108,6 +118,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 13,
|
||||
|
|
@ -118,6 +129,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 20,
|
||||
|
|
@ -128,6 +140,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 21,
|
||||
|
|
@ -138,6 +151,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 22,
|
||||
|
|
@ -148,6 +162,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 23,
|
||||
|
|
@ -158,6 +173,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 24,
|
||||
|
|
@ -168,6 +184,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 25,
|
||||
|
|
@ -178,6 +195,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 30,
|
||||
|
|
@ -188,6 +206,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 31,
|
||||
|
|
@ -198,6 +217,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 32,
|
||||
|
|
@ -208,6 +228,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 33,
|
||||
|
|
@ -218,6 +239,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 34,
|
||||
|
|
@ -228,6 +250,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 35,
|
||||
|
|
@ -238,6 +261,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 40,
|
||||
|
|
@ -248,6 +272,7 @@
|
|||
"number_format": "integer",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 100,
|
||||
|
|
@ -258,6 +283,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 101,
|
||||
|
|
@ -268,6 +294,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 102,
|
||||
|
|
@ -278,6 +305,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 110,
|
||||
|
|
@ -288,6 +316,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 111,
|
||||
|
|
@ -298,6 +327,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 120,
|
||||
|
|
@ -308,6 +338,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 121,
|
||||
|
|
@ -318,6 +349,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 122,
|
||||
|
|
@ -328,6 +360,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 123,
|
||||
|
|
@ -338,6 +371,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 130,
|
||||
|
|
@ -348,6 +382,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "ONGOING_MONTH",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 131,
|
||||
|
|
@ -358,6 +393,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "ONGOING_MONTH",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 132,
|
||||
|
|
@ -368,6 +404,7 @@
|
|||
"number_format": "percentage",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "ONGOING_MONTH",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 200,
|
||||
|
|
@ -378,6 +415,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 201,
|
||||
|
|
@ -388,6 +426,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 202,
|
||||
|
|
@ -398,6 +437,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 203,
|
||||
|
|
@ -408,6 +448,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "ONGOING_MONTH",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 204,
|
||||
|
|
@ -418,6 +459,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "ONGOING_MONTH",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 211,
|
||||
|
|
@ -428,6 +470,7 @@
|
|||
"number_format": "converted_metric_currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 212,
|
||||
|
|
@ -438,6 +481,7 @@
|
|||
"number_format": "converted_metric_currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 213,
|
||||
|
|
@ -448,6 +492,7 @@
|
|||
"number_format": "converted_metric_currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 214,
|
||||
|
|
@ -458,6 +503,7 @@
|
|||
"number_format": "converted_metric_currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 220,
|
||||
|
|
@ -468,6 +514,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 224,
|
||||
|
|
@ -478,6 +525,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 225,
|
||||
|
|
@ -488,6 +536,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 226,
|
||||
|
|
@ -498,6 +547,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 227,
|
||||
|
|
@ -508,6 +558,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 231,
|
||||
|
|
@ -518,6 +569,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 232,
|
||||
|
|
@ -528,6 +580,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 233,
|
||||
|
|
@ -538,6 +591,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 234,
|
||||
|
|
@ -548,6 +602,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 235,
|
||||
|
|
@ -558,6 +613,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 236,
|
||||
|
|
@ -568,6 +624,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 237,
|
||||
|
|
@ -578,6 +635,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 240,
|
||||
|
|
@ -588,6 +646,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 245,
|
||||
|
|
@ -598,6 +657,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 246,
|
||||
|
|
@ -608,6 +668,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": false,
|
||||
},
|
||||
{
|
||||
"order_by": 250,
|
||||
|
|
@ -618,6 +679,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 251,
|
||||
|
|
@ -628,6 +690,7 @@
|
|||
"number_format": "converted_metric_currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 252,
|
||||
|
|
@ -638,6 +701,7 @@
|
|||
"number_format": "converted_metric_currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 260,
|
||||
|
|
@ -648,6 +712,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 262,
|
||||
|
|
@ -658,6 +723,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 263,
|
||||
|
|
@ -668,6 +734,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 264,
|
||||
|
|
@ -678,6 +745,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "INVOICING",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 265,
|
||||
|
|
@ -688,6 +756,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "positive",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 270,
|
||||
|
|
@ -698,6 +767,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
{
|
||||
"order_by": 271,
|
||||
|
|
@ -708,6 +778,7 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "negative",
|
||||
"display_exclusion": "NONE",
|
||||
"include_in_account_reporting": true,
|
||||
},
|
||||
] %}
|
||||
with
|
||||
|
|
@ -728,6 +799,7 @@ with
|
|||
dimension_value,
|
||||
previous_year_date,
|
||||
{{ metric.order_by }} as order_by,
|
||||
{{ metric.include_in_account_reporting }} as include_in_account_reporting,
|
||||
-- quotation marks added because text format
|
||||
'{{ metric.number_format }}' as number_format,
|
||||
'{{ metric.display_exclusion }}' as display_exclusion,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue