Query to Calculate difference between current and previous values

I have ingested CPU utilization metric in ES. My requirement is to calculate difference between current and previous CPU value per minute Below is sample data snapshot.

2017-07-2 11:48:40, server1,processor(_total)-% processor time,3.04,System Processor Time,w3wp,APM2
2017-07-2 11:49:10, server1,processor(_total)-% processor time,3.37,System Processor Time,w3wp,APM2

Looking for something like below:
(y2-y1)/(x2-x1) where y axis is CPU utilization and x-axis is time.
e.g. (3.37-3.04)/(11:49:10-11:48:40)

Please help in achieving this.

I looks like you have already asked this question here: Compute distance between current and previous value

Please do not post the same question multiple times