# Create a ratio in Visual Builder with a numerator that is the count of documents that have a specific filter

**URL:** https://discuss.elastic.co/t/create-a-ratio-in-visual-builder-with-a-numerator-that-is-the-count-of-documents-that-have-a-specific-filter/186314
**Category:** Kibana
**Created:** [June 18, 2019, 4:43pm UTC](https://discuss.elastic.co/t/create-a-ratio-in-visual-builder-with-a-numerator-that-is-the-count-of-documents-that-have-a-specific-filter/186314 "2019-06-18T16:43:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lelwar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lelwar/32/45040_2.png) [@lelwar](https://discuss.elastic.co/u/lelwar)
#### Post date: [June 18, 2019, 4:43pm UTC](https://discuss.elastic.co/t/create-a-ratio-in-visual-builder-with-a-numerator-that-is-the-count-of-documents-that-have-a-specific-filter/186314/1 "2019-06-18T16:43:35Z")

</div>

Hello,  
Want to make a filter ratio where the numerator and denominator are from different indexes. This works very well with a count when it is only one query for the numerator and the denominator:

> response:0 / label:"whatever"

Nonetheless, for example, I am trying to get a ratio where the numerator should be filtered if it fulfills 2 conditions with no luck:

`response:0 and store:"whichever" / label:"whatever"`

I have also tried to do this with no success by a "group by" of :

> response:0 / label:"whatever"

using filter:

store:"whichever"

Is there a better way to do this?

Lel

---

<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: [June 21, 2019, 9:29am UTC](https://discuss.elastic.co/t/create-a-ratio-in-visual-builder-with-a-numerator-that-is-the-count-of-documents-that-have-a-specific-filter/186314/2 "2019-06-21T09:29:52Z")

</div>

Only way I would see this possibly working is if you have both indices in the same index pattern. This was ES would treat it as sparse data.

---

<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: [July 19, 2019, 9:29am UTC](https://discuss.elastic.co/t/create-a-ratio-in-visual-builder-with-a-numerator-that-is-the-count-of-documents-that-have-a-specific-filter/186314/3 "2019-07-19T09:29:55Z")

</div>

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