Merged PR 3731: Add 1e-6 threshold in kpis_additive_metrics_per_dimension_are_consistent
# Description Add 1e-6 threshold in kpis_additive_metrics_per_dimension_are_consistent. This should fix the issue on churn rate metrics that are rounded to this precision # Checklist - [X] The edited models and dependants run properly with production data. Only tried the test. - [ ] The edited models are sufficiently documented. - [X] The edited models contain PK tests, and I've ran and passed them. - [ ] 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: #25075
This commit is contained in:
parent
4c7820608a
commit
7a987d92c4
1 changed files with 9 additions and 6 deletions
|
|
@ -4,13 +4,16 @@ specifically on reporting.mtd_aggregated_metrics.
|
||||||
|
|
||||||
It just ensures that for the last available date, the sum of metrics
|
It just ensures that for the last available date, the sum of metrics
|
||||||
for any dimension provides an equal or lower aggregated value compared
|
for any dimension provides an equal or lower aggregated value compared
|
||||||
to what is expected at Global level. This is because some dimensions
|
to what is expected at Global level, up to a certain threshold.
|
||||||
depend on Deal, and not all users have a Deal, thus it's normal that
|
This is because some dimensions depend on Deal, and not all users
|
||||||
the aggregation might not match the Global value on a given metric.
|
have a Deal, thus it's normal that the aggregation might not match the
|
||||||
|
Global value on a given metric.
|
||||||
|
|
||||||
However, the aggregation cannot be higher than the value reported in
|
However, the aggregation cannot be higher, with a certain tolerance,
|
||||||
the Global dimension.
|
than the value reported in the Global dimension.
|
||||||
*/
|
*/
|
||||||
|
{% set tolerance_threshold = 0.000001 %}
|
||||||
|
|
||||||
{% set additive_metric_names = (
|
{% set additive_metric_names = (
|
||||||
"Cancelled Bookings",
|
"Cancelled Bookings",
|
||||||
"Check-In Hero Revenue",
|
"Check-In Hero Revenue",
|
||||||
|
|
@ -91,4 +94,4 @@ with
|
||||||
)
|
)
|
||||||
select *
|
select *
|
||||||
from difference_computation
|
from difference_computation
|
||||||
where abs_diff > 0
|
where abs_diff > {{ tolerance_threshold }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue