data-dwh-dbt-project/models
Oriol Roqué Paniagua 2130226939 Merged PR 2284: KPIs: computing invoicing metrics from Xero
This PR creates 2 new models on intermediate, xero:
- int_xero__mtd_invoicing_metrics (global view)
- int_xero__monthly_invoicing_history_by_deal (by deal view)

This allows for the computation of host metrics (operators), as well as host resolution payments. This will enable in the future to compute total revenue and weighted revenue metrics.
The data displayed from the previous months in the mtd_invoicing_metrics is consistent with 1) revenue figures displayed in business overview for Host tab, as well as Guest tab for Waiver Payments; and 2) host payment figures displayed in the accounting reports.

**Note 1**: the variables at this stage are reused in these models, as well as many other Xero models. We still need to handle the refactor ticket on Xero related reports. This is not under the scope of this PR.

**Note 2**: we noticed that the strategy for mtd models to do a double year, month extraction join is badly performant. Actually, resolution payments subquery was not performing at all with this logic. So it has been changed to a date_trunc('month', related_date)::date = d.first_day_month strategy which works much faster. I'll add a standalone PR to refactor the remaining mtd models separately later

Related work items: #18108, #18110
2024-07-12 10:05:49 +00:00
..
intermediate Merged PR 2284: KPIs: computing invoicing metrics from Xero 2024-07-12 10:05:49 +00:00
reporting Merged PR 2267: Business KPIs refactor - cleaning 2024-07-11 09:17:44 +00:00
staging missing field in stg 2024-07-08 16:29:35 +02:00
doc_blocks.md improve stg_stripe__charges 2024-02-23 16:45:19 +01:00