# Calculate difference between two consecutive rows

**URL:** <https://discuss.elastic.co/t/calculate-difference-between-two-consecutive-rows/131855>\
**Category:** Elasticsearch\
**Created:** [May 15, 2018, 6:42am UTC](https://discuss.elastic.co/t/calculate-difference-between-two-consecutive-rows/131855 "2018-05-15T06:42:50Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![nabha](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@nabha](https://discuss.elastic.co/u/nabha)\
**Post date:** [May 15, 2018, 9:16am UTC](https://discuss.elastic.co/t/calculate-difference-between-two-consecutive-rows/131855/3 "2018-05-15T09:16:03Z")

</div>

Hi Mark, I didn't find it suitable.  
My requirement is exactly same as hsiuming from [How to calculate delta value](https://discuss.elastic.co/t/how-to-calculate-delta-value/107156/2)  
That I want to perform operations on same column. I tried script but it didn't work to achieve the goal. What I want is the delta value in the same column.  
Script function seems only can calculate the value between two column.

---

_[View the full topic](https://discuss.elastic.co/t/calculate-difference-between-two-consecutive-rows/131855)._
