-
Incident report
-
Resolution: Won't fix
-
Trivial
-
None
-
1.8.11, 2.0.0rc1
I need to fire alarm when the value changes > 50%. Next trigger expression will do the trick:
{item.change(0)}/{item.last(#2)} > 0.5The problem however is in case when previous value is 0, we get division by zero. Adding a check for non-zero value
{item.last(#2)}#0 & {item.change(0)}
/
{item.last(#2)}> 0.5
will not work as before doing any logical operations all trigger expressions are evaluated. The only workaround I could think of is always adding 0.000001 to the previous value (and hope it's integer).