diff --git a/payg.cfm b/payg.cfm index 5a8afa1..8606176 100644 --- a/payg.cfm +++ b/payg.cfm @@ -572,6 +572,21 @@ WITH SELECT + s.cnt as occurrences_spec + m.cnt as occurrences_metric + CASE WHEN (m.cnt=1 AND s.cnt=1) THEN 1 ELSE 0 END as exact_match + + CASE + WHEN (m.cnt=1 AND s.cnt=1) THEN 'EXACT MATCH' + WHEN (m.cnt>1 AND s.cnt>1) THEN 'CRITICAL: Many-to-Many Explosion (Duplicates on BOTH sides)' + WHEN (s.cnt>1) THEN 'DUP: Multiple entries in Spec' + WHEN (m.cnt>1) THEN 'DUP: Multiple entries in Metrics' + WHEN (coalesce(m.cnt,0)=0 AND s.cnt>0) THEN 'ORPHAN: Only in Spec' + WHEN (m.cnt>0 AND coalesce(s.cnt,0)=0) THEN 'ORPHAN: Only in Metrics' + ELSE 'Other Discrepancy' + END as diag + + coalesce(coalesce(c.wz, m.wz), s.wz) as wz s.wz as wzs c.wz as wzc @@ -586,8 +601,8 @@ SELECT s.type s.ed_izm - CASE - -- Isolate the 3rd decimal place using MOD instead of % + CASE --inline implementation of gaussian round to 2 decimal places + -- Isolate the 3rd decimal place using MOD instead of %, hsql syntax WHEN ABS(MOD(TRUNCATE(s.discounted_price * 1000, 0), 10)) = 5 AND ABS(MOD(TRUNCATE(s.discounted_price * 100, 0), 2)) = 0 -- If it's a perfect .xx5 tie and the 2nd digit is EVEN, shave off the 5 @@ -627,9 +642,8 @@ SELECT c.responsible_email c.responsible_status - s.cnt AS occurrences_spec - m.cnt AS occurrences_metric - + + FROM metric m @@ -725,6 +739,8 @@ S3 операции и трафик: (перед выгрузкой отчета на произвольную дату или с параметрами сначала просмотрите его в браузере) +
+серая строка - нет метрик; красное число в поле "Кол-во специф." - для PAYG в спецификации кол-во не 1 @@ -759,11 +775,11 @@ S3 операции и трафик: Сырая метрика - - - + + - + class="gray"> - @@ -833,7 +836,6 @@ S3 операции и трафик: - @@ -855,10 +857,10 @@ S3 операции и трафик: - - + + - + -
Приведен­ная метрикаЦена ₽ до ск. с НДСЦена ₽ co ск. с НДС без окр.Кол-во сервиса Кол-во комп-та #currentRow##occurrences_spec#|#occurrences_metric# - - EXACT MATCH - - CRITICAL: Many-to-Many Explosion (Duplicates on BOTH sides) - - DUPLICATION: Multiple entries for this key in Spec - - DUPLICATION: Multiple entries for this key in Metrics - - ORPHAN: Only in Spec - - ORPHAN: Only in Metrics - - Other Discrepancy - + style="color:green" style="color:red"> + #occurrences_spec#|#occurrences_metric# + #diag# #abstract_service#: #modifier# style="background:lightgreen;color:black;">#s_code# #unit# [#ed_izm#] #discounted_price# #discounted_price##service_quantity# #component_quantity#