detecting if a value is increasing or not

Hi,
Is there a way to determine if a value is increasing or not?
I’d like to make a script where some parameters are being driven by somekind of move transform.
Ie: If I move my object on the X axis i`d like to know if that value is increasing or decreasing and use that to drive an IF statement