# Differentials calculus in E

**URL:** <https://discuss.elastic.co/t/differentials-calculus-in-e/146402>\
**Category:** Elasticsearch\
**Created:** [August 28, 2018, 5:21pm UTC](https://discuss.elastic.co/t/differentials-calculus-in-e/146402 "2018-08-28T17:21:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehdi-gital](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@mehdi-gital](https://discuss.elastic.co/u/mehdi-gital)\
**Post date:** [August 28, 2018, 5:21pm UTC](https://discuss.elastic.co/t/differentials-calculus-in-e/146402/1 "2018-08-28T17:21:07Z")

</div>

Here's a situation that's similar to my real question:

Let's say I'm recording the temperatures of all major cities in the world once per day. So, each document has the following fields:

timestamp  
city\_name  
temp

The type of query that I'm interested in is of the following form:

Get all cities C and timestamps T such that the temperature jumped more than a certain amount compared to the week before.

More precisely:  
temp(C, T) \> temp(C, T-one week)\*lambda

My understanding is that Elastic looks only within the documents but I don't mind being wrong if there's a built-in method for handling such queries. Obviously, my goal is to avoid writing a big wrapper around Elastic when I create my API.

Thank you!

---

<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 25, 2018, 5:21pm UTC](https://discuss.elastic.co/t/differentials-calculus-in-e/146402/2 "2018-09-25T17:21:11Z")

</div>

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