Calculate difference between current and previous values

Hi, I'm trying to create Watcher Alert for dropped packets system.network.in.dropped (the system metrics are shipped with Metricbeats) if more than 50 dropped packets are present alert should be generated. To do this I need calculate difference between current and previous values.

What is the best way of doing it?

i hope derivative aggregation might help in this situation.