# Graphing aggregation difference in Kibana

**URL:** https://discuss.elastic.co/t/graphing-aggregation-difference-in-kibana/169160
**Category:** Kibana
**Created:** [February 20, 2019, 8:18am UTC](https://discuss.elastic.co/t/graphing-aggregation-difference-in-kibana/169160 "2019-02-20T08:18:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jetze\_Schaafsma](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@Jetze\_Schaafsma](https://discuss.elastic.co/u/Jetze_Schaafsma)
#### Post date: [February 20, 2019, 8:18am UTC](https://discuss.elastic.co/t/graphing-aggregation-difference-in-kibana/169160/1 "2019-02-20T08:18:26Z")

</div>

I have 'start' and 'end' events (so, separate documents in my 'events' index) for doing work.

I don't really care about how often I start or stop; I particularly care about their difference!

Now, as a hack, I could do ugly things like using +1 for start, and -1 for end, and aggregate over the sum, but I don't want to do that.

I understand from this thread ([How to find the difference of two metric aggregations in kibana](https://discuss.elastic.co/t/how-to-find-the-difference-of-two-metric-aggregations-in-kibana/27579)) that it wasn't possible in the past. Did anything change in the mean time? Is this coming in the near future?

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [February 20, 2019, 8:40pm UTC](https://discuss.elastic.co/t/graphing-aggregation-difference-in-kibana/169160/2 "2019-02-20T20:40:56Z")

</div>

There isn't really a great way to accomplish this in Kibana as there is no concept of "joining" documents based on a key. What you might consider doing instead is calculating the difference when indexing the "stop" document and adding it as a separate field (`millis_elapsed` or something).

---

<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: [March 20, 2019, 8:41pm UTC](https://discuss.elastic.co/t/graphing-aggregation-difference-in-kibana/169160/3 "2019-03-20T20:41:02Z")

</div>

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