# Representing ratio between two indexes or visualization

**URL:** https://discuss.elastic.co/t/representing-ratio-between-two-indexes-or-visualization/199422
**Category:** Kibana
**Created:** [September 13, 2019, 12:23pm UTC](https://discuss.elastic.co/t/representing-ratio-between-two-indexes-or-visualization/199422 "2019-09-13T12:23:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Juan\_Francisco\_Verho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juan_francisco_verho/32/54156_2.png) [@Juan\_Francisco\_Verho](https://discuss.elastic.co/u/Juan_Francisco_Verho)
#### Post date: [September 13, 2019, 12:23pm UTC](https://discuss.elastic.co/t/representing-ratio-between-two-indexes-or-visualization/199422/1 "2019-09-13T12:23:41Z")

</div>

Let's suppose I have two indexes and one visualization for each one:

IndexA with unique count of views per week  
IndexB with unique count of likes per week

I would like to create a third visualization that is the ratio of views/likes for every week.  
How can I 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: [September 13, 2019, 1:05pm UTC](https://discuss.elastic.co/t/representing-ratio-between-two-indexes-or-visualization/199422/2 "2019-09-13T13:05:35Z")

</div>

Use the Math aggregation in the Visual Builder visualization. It will allow you to do most math operations on metrics.

---

<div class="post-metadata">

### Author: ![Juan\_Francisco\_Verho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juan_francisco_verho/32/54156_2.png) [@Juan\_Francisco\_Verho](https://discuss.elastic.co/u/Juan_Francisco_Verho)
#### Post date: [September 17, 2019, 1:56pm UTC](https://discuss.elastic.co/t/representing-ratio-between-two-indexes-or-visualization/199422/3 "2019-09-17T13:56:39Z")

</div>

I'm sorry. Can you be a little more specific? I tried with the Visual Builder filter ratio option but no luck.

---

<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: [September 19, 2019, 1:39pm UTC](https://discuss.elastic.co/t/representing-ratio-between-two-indexes-or-visualization/199422/4 "2019-09-19T13:39:06Z")

</div>

Use the Math option in the aggregations.

---

<div class="post-metadata">

### Author: ![Juan\_Francisco\_Verho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juan_francisco_verho/32/54156_2.png) [@Juan\_Francisco\_Verho](https://discuss.elastic.co/u/Juan_Francisco_Verho)
#### Post date: [September 19, 2019, 7:43pm UTC](https://discuss.elastic.co/t/representing-ratio-between-two-indexes-or-visualization/199422/5 "2019-09-19T19:43:58Z")

</div>

Thanks but I don't know if that applies to my case. I can't add a math aggregation before applying filters.

 ![34%20PM](https://us1.discourse-cdn.com/elastic/original/3X/6/c/6cee95883daef5d8e8cd57ddfa765cba7960eea8.png)

Besides the previous structure, I'm also applying filters to get specific elements and I want to divide the two series after. I'm trying with both timelion and the visual builder.

I'm including screenshots:

 ![20%20PM](https://us1.discourse-cdn.com/elastic/original/3X/a/3/a36cc365a0668a9ff01a89aa5df6e8a3a2ae12bd.png)  
 ![38%20PM](https://us1.discourse-cdn.com/elastic/original/3X/a/6/a6e761afb42a180778e382c9048fd7aac0fd8604.png)

---

<div class="post-metadata">

### Author: ![Juan\_Francisco\_Verho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juan_francisco_verho/32/54156_2.png) [@Juan\_Francisco\_Verho](https://discuss.elastic.co/u/Juan_Francisco_Verho)
#### Post date: [September 20, 2019, 4:57pm UTC](https://discuss.elastic.co/t/representing-ratio-between-two-indexes-or-visualization/199422/6 "2019-09-20T16:57:53Z")

</div>

Okay so timelion has a divide function for the timeseries. Is there something similar for the visual builder?

---

<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: [October 18, 2019, 4:57pm UTC](https://discuss.elastic.co/t/representing-ratio-between-two-indexes-or-visualization/199422/7 "2019-10-18T16:57:57Z")

</div>

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