# Filter Ratio in metric not showing results as expected

**URL:** https://discuss.elastic.co/t/filter-ratio-in-metric-not-showing-results-as-expected/226049
**Category:** Kibana
**Created:** [April 1, 2020, 12:54pm UTC](https://discuss.elastic.co/t/filter-ratio-in-metric-not-showing-results-as-expected/226049 "2020-04-01T12:54:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Be1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/be1/32/63657_2.png) [@Be1](https://discuss.elastic.co/u/Be1)
#### Post date: [April 1, 2020, 12:54pm UTC](https://discuss.elastic.co/t/filter-ratio-in-metric-not-showing-results-as-expected/226049/1 "2020-04-01T12:54:58Z")

</div>

Hi All,  
I am using the TSVB to use filter ratio to divide two values  
I need to divide the sum of tcv of just presales stage closed / win with the total tcv  
Below is the configuration I used

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/1/21c87259e87e854301defdf721847ee7b92e66c5.png)

The filter used in numerator is `Pre-Sales Stage :"Stage 6: Closed Win" OR Pre-Sales Stage : "Stage 6: Won" `

The result shows 0 but when i format in percent ,it shows 0.05%  
The result is far variated  
I should be getting 6.45%  
Also the filter used in numerator behaves weird  
when I use `Pre-Sales Stage :"Stage 6: Closed Win" ` the value appears 0%  
but if i include 'or' at the end `Pre-Sales Stage :"Stage 6: Closed Win" or ` ,the values shows 0.05%

I also tried using the query string format...still I get the results far variated.

Please if somebody could help.  
Also i am using Kibana 7.6.1  
Below is the panel option and option tab settings

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0a70a2223a590858c3707a48245b3eb95a207441.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/a/ca843d6e77c5022accea22d3847da1504308b7e3.png)  
Thank you

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [April 2, 2020, 7:42am UTC](https://discuss.elastic.co/t/filter-ratio-in-metric-not-showing-results-as-expected/226049/2 "2020-04-02T07:42:08Z")

</div>

Is `Pre-Sales Stage` your field name? If yes, I think you have to escape the space like described here: [https://stackoverflow.com/questions/23257495/lucene-query-syntax-of-field-with-a-space](https://stackoverflow.com/questions/23257495/lucene-query-syntax-of-field-with-a-space)

You can test whether the queries you are using for numerator/denominator are working correctly by going to discover, setting the search bar to Lucene and checking whether the right documents are shown.

---

<div class="post-metadata">

### Author: ![Be1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/be1/32/63657_2.png) [@Be1](https://discuss.elastic.co/u/Be1)
#### Post date: [April 2, 2020, 7:55am UTC](https://discuss.elastic.co/t/filter-ratio-in-metric-not-showing-results-as-expected/226049/3 "2020-04-02T07:55:02Z")

</div>

Thanks a lot.

---

<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: [April 30, 2020, 7:55am UTC](https://discuss.elastic.co/t/filter-ratio-in-metric-not-showing-results-as-expected/226049/4 "2020-04-30T07:55:17Z")

</div>

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