# Visualize a value that is calculated by the period of time with next value

**URL:** <https://discuss.elastic.co/t/visualize-a-value-that-is-calculated-by-the-period-of-time-with-next-value/273056>\
**Category:** Kibana\
**Created:** [May 14, 2021, 6:39pm UTC](https://discuss.elastic.co/t/visualize-a-value-that-is-calculated-by-the-period-of-time-with-next-value/273056 "2021-05-14T18:39:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juanfri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juanfri/32/77625_2.png) [@Juanfri](https://discuss.elastic.co/u/Juanfri)\
**Post date:** [May 14, 2021, 6:39pm UTC](https://discuss.elastic.co/t/visualize-a-value-that-is-calculated-by-the-period-of-time-with-next-value/273056/1 "2021-05-14T18:39:00Z")

</div>

Hi, i want to obtain a visualization with a calculated value. In order to calculate that value, i have to know the time of the next value, but I have no idea how to get some sort of array in order to make this kind of visualization. I have try TSVB and another ways of visualize, but I dont know how to approach this (I can't ingest new values with Logstash).

Thank you.

---

<div class="post-metadata">

**Author:** ![Juanfri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juanfri/32/77625_2.png) [@Juanfri](https://discuss.elastic.co/u/Juanfri)\
**Post date:** [May 17, 2021, 8:38am UTC](https://discuss.elastic.co/t/visualize-a-value-that-is-calculated-by-the-period-of-time-with-next-value/273056/2 "2021-05-17T08:38:38Z")

</div>

Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [May 17, 2021, 1:30pm UTC](https://discuss.elastic.co/t/visualize-a-value-that-is-calculated-by-the-period-of-time-with-next-value/273056/3 "2021-05-17T13:30:37Z")

</div>

Can you give an example on what you would need? My initial inclination is that it's not possible, but there might be some workarounds if we can get a concrete example.

---

<div class="post-metadata">

**Author:** ![Juanfri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juanfri/32/77625_2.png) [@Juanfri](https://discuss.elastic.co/u/Juanfri)\
**Post date:** [May 17, 2021, 2:21pm UTC](https://discuss.elastic.co/t/visualize-a-value-that-is-calculated-by-the-period-of-time-with-next-value/273056/4 "2021-05-17T14:21:07Z")

</div>

Ok, lets try to make a good example.

In first place, we have this data (The first one is a date value that is the timestamp and the second one is an arbitrary value):

- 03:43:22.000, 10
- 03:43:24.500, 15
- 03:43:25.000, 20

In order to calculate the value for the first line of data, I need the time in seconds between the first line of data and the second line of data (2.5s) and the value of the first line (10). In order to calculate the calculated value on the second line, I will need the time difference between 2º line and 3º line (0.5s) and the value of second line (15) and so on.

Is there a way to make something like this? Thank you for your patience and sorry for my poor English 🙂

---

<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:** [June 14, 2021, 2:21pm UTC](https://discuss.elastic.co/t/visualize-a-value-that-is-calculated-by-the-period-of-time-with-next-value/273056/5 "2021-06-14T14:21:51Z")

</div>

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