From ddc806583c46f0ad60d683b223ef39b4b8a74b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Roqu=C3=A9=20Paniagua?= Date: Tue, 21 Jan 2025 13:22:36 +0000 Subject: [PATCH] Merged PR 4130: Propagate aggregations to xero sales reporting # Description Propagates the xero aggregations to the reporting model of xero__sales_denom_mart # 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: #26618 --- models/reporting/xero/schema.yml | 16 ++++++++++++++++ models/reporting/xero/xero__sales_denom_mart.sql | 6 ++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/models/reporting/xero/schema.yml b/models/reporting/xero/schema.yml index cdb021a..eb3f251 100644 --- a/models/reporting/xero/schema.yml +++ b/models/reporting/xero/schema.yml @@ -1364,3 +1364,19 @@ models: - name: contact_name data_type: character varying description: "" + + - name: accounting_root_aggregation + data_type: character varying + description: | + The root aggregation per account code. This is the main + aggregation that is used to retrieve low-level data. + + - name: accounting_kpis_aggregation + data_type: character varying + description: | + The default macro-aggregation for Invoiced KPIs. + + - name: accounting_financial_aggregation + data_type: character varying + description: | + The default macro-aggregation for Financial reporting. diff --git a/models/reporting/xero/xero__sales_denom_mart.sql b/models/reporting/xero/xero__sales_denom_mart.sql index a5bdf80..9be9224 100644 --- a/models/reporting/xero/xero__sales_denom_mart.sql +++ b/models/reporting/xero/xero__sales_denom_mart.sql @@ -39,6 +39,8 @@ select sdm.header_total_due_in_gbp as header_total_due_in_gbp, sdm.id_contact as id_contact, sdm.id_deal as id_deal, - sdm.contact_name as contact_name - + sdm.contact_name as contact_name, + sdm.accounting_root_aggregation as accounting_root_aggregation, + sdm.accounting_kpis_aggregation as accounting_kpis_aggregation, + sdm.accounting_financial_aggregation as accounting_financial_aggregation from int_xero__sales_denom_mart sdm