# Positive flow rate over time for tank level

**URL:** <https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463>\
**Category:** Kibana\
**Created:** [March 20, 2020, 5:47pm UTC](https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463 "2020-03-20T17:47:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![thoth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thoth/32/40765_2.png) [@thoth](https://discuss.elastic.co/u/thoth)\
**Post date:** [March 20, 2020, 5:47pm UTC](https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463/1 "2020-03-20T17:47:23Z")

</div>

I have a 'level' value for a tank coming in as a number, which is searchable and aggregatable. Is it possible for me to get a rate over time in which this level is increasing? As the tank nears full it is emptied and this gives a negative rate over a short period of time, can this be ignored?

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [March 20, 2020, 11:42pm UTC](https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463/2 "2020-03-20T23:42:15Z")

</div>

Hi @thoth,

How are you hoping to visualize this data? If you are doing something like a line chart, you could try filtering to remove any documents where the number is negative.

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [March 21, 2020, 1:51am UTC](https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463/3 "2020-03-21T01:51:04Z")

</div>

This sounds like an old physics problem, full of things you may not think about. Does inflow continue while the drain occurs? Is the drain rate consistent? Say the drain is 100/sec, and 1000 is always drained. But the drain takes 11 seconds? That means there was a 100 inflow during the 11 sec drain.

---

<div class="post-metadata">

**Author:** ![thoth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thoth/32/40765_2.png) [@thoth](https://discuss.elastic.co/u/thoth)\
**Post date:** [March 21, 2020, 3:24am UTC](https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463/4 "2020-03-21T03:24:57Z")

</div>

@lukeelmers I just need the metrics, but a gauge might also work. Of note, the documents won't ever be negative, merely the level value will reduce over a short period while the tank is being drained as the level approaches zero. So the rate _at the time while the tank was being drained_ would go negative.

@rugenl No open drain while filling so none of that calculus. Just a simple first order derivative on what is coming in.

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [March 21, 2020, 2:08pm UTC](https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463/5 "2020-03-21T14:08:57Z")

</div>

Is it just a TSVB derivative graph and a filter with value \> 0?

---

<div class="post-metadata">

**Author:** ![thoth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thoth/32/40765_2.png) [@thoth](https://discuss.elastic.co/u/thoth)\
**Post date:** [March 21, 2020, 5:33pm UTC](https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463/6 "2020-03-21T17:33:54Z")

</div>

I did not know about the derivative graph in TSVB, this seems to be pretty close to what I was looking for. However, putting `value > 0` in the filter does not seem to work (as my values are never negative). So long as I keep the time between drains this does work. But is it possible for me to ignore the drainings?

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [March 23, 2020, 7:14pm UTC](https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463/7 "2020-03-23T19:14:41Z")

</div>

Ok, so level is like 1, 2, 3, 4, 5 6, 1. The drain occurred between 6 and 1. I think there is a diff function between values is TSVB, but I'll have to research.

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [March 23, 2020, 7:23pm UTC](https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463/8 "2020-03-23T19:23:52Z")

</div>

What I thought I remembered was in another product, not Kibana. Maybe someone else will know.

---

<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:** [April 20, 2020, 7:23pm UTC](https://discuss.elastic.co/t/positive-flow-rate-over-time-for-tank-level/224463/9 "2020-04-20T19:23:53Z")

</div>

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