Merged PR 2577: Adding get_kpi_dimensions_for_production

# Description

Takes into account @<Pablo Martín> 's feedback from the previous PR, slightly modified. This PR separates 1) the dimensions while developing vs. 2) the dimensions once these are available for production. This are within the same file of macro configuration for KPIs, namely `business_kpis_configuration`.

End-goal, all CTEs in `int_mtd_vs_previous_year_metrics` will read from this new macro `get_kpi_dimensions_for_production`, so eventually we won't need any hardcode once we want to add new dimensions. In the meantime, I'll be adding this new line for each PR (still 2 missing :D)

# Checklist

- [X] The edited models and dependants run properly with production data.
- [X] The edited models are sufficiently documented.
- [ ] 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.
- [ ] 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: #19325
This commit is contained in:
Oriol Roqué Paniagua 2024-08-19 09:57:28 +00:00
parent 89dd8845cc
commit 997cb85c6c
2 changed files with 25 additions and 8 deletions

View file

@ -1,13 +0,0 @@
/*
Provides a general configuration for the Dimensions available for the KPIs.
Please note that strings should be encoded with " ' your_value_here ' ",
while fields from tables should be specified like " your_field_here "
*/
{% macro get_kpi_dimensions() %}
{% set dimensions = [
{"dimension": "'global'", "dimension_value": "'global'"},
{"dimension": "'by_number_of_listings'", "dimension_value": "active_accommodations_per_deal_segmentation"}
] %}
{{ return(dimensions) }}
{% endmacro %}