# Division on metric result

**URL:** <https://discuss.elastic.co/t/division-on-metric-result/249111>\
**Category:** Kibana\
**Created:** [September 18, 2020, 2:00pm UTC](https://discuss.elastic.co/t/division-on-metric-result/249111 "2020-09-18T14:00:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cheroufa](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Cheroufa](https://discuss.elastic.co/u/Cheroufa)\
**Post date:** [September 18, 2020, 2:00pm UTC](https://discuss.elastic.co/t/division-on-metric-result/249111/1 "2020-09-18T14:00:21Z")

</div>

Hi gays i want to divide the metric result on 2 how i can do this in kibana ?  
 ![Sans titrehhhhhhhhhhhhhhhhhhhhh](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7ecf09b2e3dbb23284774db4861229029400c0a8.png)

with unique count i have 53 so i want to display 26.5 which is 53/2

thanx for help.

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [October 12, 2020, 10:35am UTC](https://discuss.elastic.co/t/division-on-metric-result/249111/2 "2020-10-12T10:35:07Z")

</div>

Hi,

sorry for the late reply. Did you manage to solve your issue?

---

<div class="post-metadata">

**Author:** ![Cheroufa](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Cheroufa](https://discuss.elastic.co/u/Cheroufa)\
**Post date:** [October 12, 2020, 11:02am UTC](https://discuss.elastic.co/t/division-on-metric-result/249111/3 "2020-10-12T11:02:29Z")

</div>

Hi  
No not yet.

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [October 12, 2020, 11:24am UTC](https://discuss.elastic.co/t/division-on-metric-result/249111/4 "2020-10-12T11:24:32Z")

</div>

Hi Cheroufa,  
we only support math operations on TSVB, Vega and timelion.

if your data is time-based, then I'd recommend you to go with tsvb, here's the demo configuration:

1. Choose metric in TSVB. Setup timerange properly (in the range when you expect your data to have come). To include last bucket, in 'panel options' select option 'no' in Drop last bucket. I've chosen the interval 1y here (less calculations for ES) but it shouldn't affect the results.  

2. The first 'count' aggregation (or whatever you are visualizing) will give you the count of records in the interval you've set (so in my case 1 year). If you want to sum all the counts accross the whole timerange, add aggregation 'cumulative sum' on the top. This will give you the total count of records. All you have to do now is to divide it by 2 with 'math' aggregation.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/0/e054570ef58bfc2cf58ae1eb20113d764dbd1db2.png)

The other options is Vega visualization, but it's not trivial. Please, review the tutorials [vega](https://vega.github.io/vega/tutorials/) and [elastic](https://www.elastic.co/guide/en/kibana/7.9/vega-lite-tutorial.html) provides.

Best, Marta

---

<div class="post-metadata">

**Author:** ![Cheroufa](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Cheroufa](https://discuss.elastic.co/u/Cheroufa)\
**Post date:** [October 12, 2020, 1:05pm UTC](https://discuss.elastic.co/t/division-on-metric-result/249111/5 "2020-10-12T13:05:35Z")

</div>

Thanx a lot for the solution. 😇

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [October 12, 2020, 1:16pm UTC](https://discuss.elastic.co/t/division-on-metric-result/249111/6 "2020-10-12T13:16:42Z")

</div>

You're welcome!

---

<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, 2020, 1:16pm UTC](https://discuss.elastic.co/t/division-on-metric-result/249111/7 "2020-11-09T13:16:43Z")

</div>

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