Anomaly Formula: Percentage By Last

What it does:
This rule compares the most recent usage value with the previous one. If the percentage change meets or exceeds your defined threshold, and the direction of change matches your selected type (Increased, Decreased, or Any), an alert is triggered.

 

When to use it:
Use this formula to detect sudden relative increases or decreases in your usage, especially when absolute changes might seem small but are significant compared to recent patterns..

 


Mathematical Formula:

 

Let:
• L = Latest Value
 P = Previous Value
 T = Threshold (as a percentage)
•  = Percentage Change
• = (|L − P| / P) × 100

 

Anomaly Condition:

= (|L − P| / P) × 100 ≥ T

 

Direction Validation (based on Change Type):


• If Change Type = Increased, condition is valid only if  L > P
• If Change Type = Decreased, condition is valid only if  L < P
• If Change Type = Any, direction check is not required

 

 

Outcomes:


❌ Anomaly Detected →  ≥ T and direction matches Change Type
☑️ Skipped →  ≥ T, but direction does not match Change Type
✅ Normal →  < T

 


Examples:

 

Example 1

Change Type: Increased
Threshold: 10%
History: 200, 220

 

  • If Latest Value = 230
    Result: Normal ✅
    Explanation:
      %Δ = (230 − 220) / 220 × 100 = 4.55%
      Percentage Change (4.55%) < Threshold (10%)

 

  • If Latest Value = 260
    Result: Anomaly Detected ❌
    Explanation:
      %Δ = (260 − 220) / 220 × 100 = 18.18%
      Percentage Change (18.18%) ≥ Threshold (10%)

 

  • If Latest Value = 180
    Result: Skipped ☑️
    Explanation:
      %Δ = |180 − 220| / 220 × 100 = 18.18%
      Percentage Change (18.18%) ≥ Threshold (10)
      But direction = Decrease → does not match “Increased”

Example 2
Change Type: Decreased
Threshold: 15%
History: 500, 480

 

  • If Latest Value = 470
    Result: Normal ✅
    Explanation:
      %Δ = (480 − 470) / 480 × 100 = 2.08%
      Percentage Change (2.08%) < Threshold (15%)

 

  • If Latest Value = 400
    Result: Anomaly Detected ❌
    Explanation:
      %Δ = (480 − 400) / 480 × 100 = 16.67%
      Percentage Change (16.67%) ≥ Threshold (15)

 

  • If Latest Value = 530
    Result: Skipped ☑️
    Explanation:
      %Δ = (530 − 480) / 480 × 100 = 10.42%
      Percentage Change (10.42%) ≥ Threshold (15)
      But direction = Increase → does not match “Decreased”

Example 3
Change Type: Any
Threshold: 12%
History: 300, 320

 

  • If Latest Value = 325
    Result: Normal ✅
    Explanation:
      %Δ = (325 − 320) / 320 × 100 = 1.56%
      Percentage Change (1.56%) < Threshold (12%)

 

  • If Latest Value = 370
    Result: Anomaly Detected ❌
    Explanation:
      %Δ = (370 − 320) / 320 × 100 = 15.63%
      Percentage Change (15.63%) ≥ Threshold (12