diff --git a/tests/kpis_additive_metrics_per_dimension_are_consistent.sql b/tests/kpis_additive_metrics_per_dimension_are_consistent.sql index 2cbab91..a49bd53 100644 --- a/tests/kpis_additive_metrics_per_dimension_are_consistent.sql +++ b/tests/kpis_additive_metrics_per_dimension_are_consistent.sql @@ -4,13 +4,16 @@ specifically on reporting.mtd_aggregated_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 -to what is expected at Global level. This is because some dimensions -depend on Deal, and not all users have a Deal, thus it's normal that -the aggregation might not match the Global value on a given metric. +to what is expected at Global level, up to a certain threshold. +This is because some dimensions depend on Deal, and not all users +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 -the Global dimension. +However, the aggregation cannot be higher, with a certain tolerance, +than the value reported in the Global dimension. */ +{% set tolerance_threshold = 0.000001 %} + {% set additive_metric_names = ( "Cancelled Bookings", "Check-In Hero Revenue", @@ -91,4 +94,4 @@ with ) select * from difference_computation -where abs_diff > 0 +where abs_diff > {{ tolerance_threshold }}