# Subtract two numbers in different events but same index

**URL:** <https://discuss.elastic.co/t/subtract-two-numbers-in-different-events-but-same-index/286519>\
**Category:** Kibana\
**Created:** [October 12, 2021, 2:55pm UTC](https://discuss.elastic.co/t/subtract-two-numbers-in-different-events-but-same-index/286519 "2021-10-12T14:55:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adixon\_Diaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adixon_diaz/32/91182_2.png) [@Adixon\_Diaz](https://discuss.elastic.co/u/Adixon_Diaz)\
**Post date:** [October 12, 2021, 2:55pm UTC](https://discuss.elastic.co/t/subtract-two-numbers-in-different-events-but-same-index/286519/1 "2021-10-12T14:55:38Z")

</div>

Hi Comunity,

I would like to Subtract two numbers in different events but same index.

![substrac](https://us1.discourse-cdn.com/elastic/original/3X/5/0/502aac04dbfe7de5e5c97e31dd2812fcc85580e4.jpeg)

I tried by sql workbreanch, but there aren't a functions thats works for this.

> **[Functions](https://opensearch.org/docs/latest/search-plugins/sql/functions/#mathematical)**
>
> Functions

Do you have any another idea?

Thank, reggards.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 12, 2021, 8:26pm UTC](https://discuss.elastic.co/t/subtract-two-numbers-in-different-events-but-same-index/286519/2 "2021-10-12T20:26:51Z")

</div>

Unfortunately we are not able to help on this as opensearch is an aws run fork of Elasticsearch and Kibana.

---

<div class="post-metadata">

**Author:** ![Adixon\_Diaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adixon_diaz/32/91182_2.png) [@Adixon\_Diaz](https://discuss.elastic.co/u/Adixon_Diaz)\
**Post date:** [October 12, 2021, 9:34pm UTC](https://discuss.elastic.co/t/subtract-two-numbers-in-different-events-but-same-index/286519/3 "2021-10-12T21:34:45Z")

</div>

> [@warkolm](#):
>
> Unfortunately we are not able to help on this as opensearch is an aws run fork of Elasticsearch and Kibana.

Hi, you mean that AWS should said me how to do this in Kibana?

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 12, 2021, 9:36pm UTC](https://discuss.elastic.co/t/subtract-two-numbers-in-different-events-but-same-index/286519/4 "2021-10-12T21:36:58Z")

</div>

Ultimately it's not Kibana, it's a fork, and that plugin is not something we support.

---

<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 9, 2021, 9:37pm UTC](https://discuss.elastic.co/t/subtract-two-numbers-in-different-events-but-same-index/286519/5 "2021-11-09T21:37:51Z")

</div>

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