# Show Max and Min value for given period

**URL:** https://discuss.elastic.co/t/show-max-and-min-value-for-given-period/253435
**Category:** Kibana
**Created:** [October 27, 2020, 12:22pm UTC](https://discuss.elastic.co/t/show-max-and-min-value-for-given-period/253435 "2020-10-27T12:22:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bubba](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bubba/32/77940_2.png) [@bubba](https://discuss.elastic.co/u/bubba)
#### Post date: [October 27, 2020, 12:22pm UTC](https://discuss.elastic.co/t/show-max-and-min-value-for-given-period/253435/1 "2020-10-27T12:22:18Z")

</div>

Hi All,

I'm measuring temperature with a sensor, send it to Logstash -\> Elasticsearch. Currently everything is going well with temperature change visualizer, but I play a lot with all other available visualizers last 2 days and I have no idea how to create/config visualizer and to show at which date/hour was MAX temperature and on which date/hour was MIN temperature for given period, for example - 1 day, one week or one month. It doesn't matter what kind will be - table, bar-chart or whatever, I just want to have for example:

Period: 01.01.2020 00:00:00 - 01.02.2020 23:59:50  
max temp: 23.4 at 10.01.2020 22:30:00  
min temp: 19.2 at 22.01.2020 02:30:00

Thanks in advance

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [October 30, 2020, 8:01am UTC](https://discuss.elastic.co/t/show-max-and-min-value-for-given-period/253435/2 "2020-10-30T08:01:24Z")

</div>

This should be doable using two metric visualizations (one for max, one for min) using the "top hit" agg to fetch the timestamp of the maximum temperature:

 ![Screenshot 2020-10-30 at 08.59.40](https://us1.discourse-cdn.com/elastic/original/3X/5/6/566d19947e44944a958cfb811c8faafc63cedae8.png)

The second metric here is just showing the max of a field (that's the easy part) - the first metric is fetching the first document ordered by the same field (descending for max, for min you need to use ascending) showing the timestamp

---

<div class="post-metadata">

### Author: ![bubba](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bubba/32/77940_2.png) [@bubba](https://discuss.elastic.co/u/bubba)
#### Post date: [October 30, 2020, 9:48am UTC](https://discuss.elastic.co/t/show-max-and-min-value-for-given-period/253435/3 "2020-10-30T09:48:09Z")

</div>

Hi Joe,

Thanks for the advice, it work as charm 🙂

 ![Screenshot_20201030_114626](https://us1.discourse-cdn.com/elastic/original/3X/b/a/ba80f2b67153e4537193292b114b996eaa6ed312.png)

---

<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: [November 27, 2020, 9:48am UTC](https://discuss.elastic.co/t/show-max-and-min-value-for-given-period/253435/4 "2020-11-27T09:48:24Z")

</div>

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