# Serial Differencing where operand records are returned

**URL:** <https://discuss.elastic.co/t/serial-differencing-where-operand-records-are-returned/98458>\
**Category:** Elasticsearch\
**Created:** [August 26, 2017, 3:59pm UTC](https://discuss.elastic.co/t/serial-differencing-where-operand-records-are-returned/98458 "2017-08-26T15:59:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickian](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@patrickian](https://discuss.elastic.co/u/patrickian)\
**Post date:** [August 26, 2017, 3:59pm UTC](https://discuss.elastic.co/t/serial-differencing-where-operand-records-are-returned/98458/1 "2017-08-26T15:59:02Z")

</div>

Is there a way for elasticsearch to look at the documents, perform subtraction on a single field (similar to serial difference) and get two specific records that produced a difference that exceeds a defined threshold? Let me give an example...

Let's say I have 100 records, all with date fields. I want to do serial differencing on all these date fields and get the 2 documents where, let's say, the difference exceeded 1 hour.

Is there an 'easy' way for elasticsearch to do this? If none, is there a 'hard' way of doing it? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 23, 2017, 3:59pm UTC](https://discuss.elastic.co/t/serial-differencing-where-operand-records-are-returned/98458/2 "2017-09-23T15:59:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
