Anomaly Formula: Amount By Last

What it does:

This rule compares the most recent value in your usage history with the previous one. If the absolute difference between them meets or exceeds your defined threshold, and the type of change (increase or decrease) matches what you’ve selected, you’ll receive an alert.

 

When to use it:

Use this formula when you want to detect sudden jumps or drops in your spending from one period to the next—great for catching unexpected charges or immediate drops in activity.

 


Mathematical Formula:

 

Let:
• L = Latest Value
• P = Previous Value
• T = Threshold
• D = |L − P| (absolute difference)

 

Anomaly Condition:

D = |L − P| ≥ 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 → D ≥ T and direction matches Change Type
☑️ Skipped → D ≥ T, but direction does not match Change Type
✅ Normal → D < T

 


Examples:

 

Example 1

Change Type: Increased
Threshold: 40
History: 300, 350

 

  • If Latest Value = 375
    Result: Normal ✅
    Explanation:
      Change: 375 − 350 = 25
      Absolute Difference (25) < Threshold (40)

 

  • If Latest Value = 395
    Result: Anomaly Detected ❌
    Explanation:
      Change: 395 − 350 = 45
      Absolute Difference (45) ≥ Threshold (40)

 

  • If Latest Value = 120
    Result: Skipped ☑️
    Explanation:
      Change: 120 − 350 = −230
      Absolute Difference (230) ≥ Threshold (40)
      But direction = Decrease → does not match “Increased”


Example 2

Change Type: Decreased
Threshold: 25
History: 500, 480

 

  • If Latest Value = 470
    Result: Normal ✅
    Explanation:
      Change: 470 − 480 = −10
      Absolute Difference (10) < Threshold (25)

 

  • If Latest Value = 440
    Result: Anomaly Detected ❌
    Explanation:
      Change: 440 − 480 = −40
      Absolute Difference (40) ≥ Threshold (25)

 

  • If Latest Value = 510
    Result: Skipped ☑️
    Explanation:
      Change: 510 − 480 = 30
      Absolute Difference (30) ≥ Threshold (25)
      But direction = Increase → does not match “Decreased”


Example 3

Change Type: Any
Threshold: 50
History: 600, 620

 

  • If Latest Value = 630
    Result: Normal ✅
    Explanation:
      Change: 630 − 620 = 10
      Absolute Difference (10) < Threshold (50)

 

  • If Latest Value = 700
    Result: Anomaly Detected ❌
    Explanation:
      Change: 700 − 620 = 80
      Absolute Difference (80) ≥ Threshold (50)