# Visualize ratio in % over time

**URL:** <https://discuss.elastic.co/t/visualize-ratio-in-over-time/178948>\
**Category:** Kibana\
**Created:** [April 29, 2019, 1:56pm UTC](https://discuss.elastic.co/t/visualize-ratio-in-over-time/178948 "2019-04-29T13:56:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuBr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jubr/32/45243_2.png) [@JuBr](https://discuss.elastic.co/u/JuBr)\
**Post date:** [April 29, 2019, 1:56pm UTC](https://discuss.elastic.co/t/visualize-ratio-in-over-time/178948/1 "2019-04-29T13:56:37Z")

</div>

Hi everyone,

I am currently using Kibana Version 6.3.2. I am stuck with a little problem and therefore appreciate every help. I am not coming from the tech-site, so please excuse wrong wordings.

**Problem**  
My log-data contains an order-deadline (date) and a second date, which states when the order was finished. The aim is to do a visualization of the number of missed Deadlines **(in % !!! )** over time.

**Current Situation**  
In order to know if the deadline was missed I created the following scripted field:

def i = (doc['deadline'].date.getMillis() - doc['date'].date.getMillis()) / 3600000;  
if (i \< 0)  
{return "deadline missed";}  
return "deadline not missed";

The scripted field works fine. But since Kibana does not support filtering for scripted fields, I cannot use Visual Builder or Timelion to show the number in %. Using a pie chart does not help me since I do want to show it changed over time.

Have you got any other idea how I could get to the desired solution? Have I missed something?

Thank you very much in advance for your help.

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [April 29, 2019, 2:20pm UTC](https://discuss.elastic.co/t/visualize-ratio-in-over-time/178948/2 "2019-04-29T14:20:07Z")

</div>

Right now your scripted field is a string. If you return the field as a number, you should be able to use a field formatter to format the number as a percentage.

---

<div class="post-metadata">

**Author:** ![JuBr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jubr/32/45243_2.png) [@JuBr](https://discuss.elastic.co/u/JuBr)\
**Post date:** [April 29, 2019, 3:06pm UTC](https://discuss.elastic.co/t/visualize-ratio-in-over-time/178948/3 "2019-04-29T15:06:17Z")

</div>

Thank you very much. Now it works properly!

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [April 29, 2019, 3:15pm UTC](https://discuss.elastic.co/t/visualize-ratio-in-over-time/178948/4 "2019-04-29T15:15:44Z")

</div>

Great, glad to be of help.

---

<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:** [May 27, 2019, 3:28pm UTC](https://discuss.elastic.co/t/visualize-ratio-in-over-time/178948/5 "2019-05-27T15:28:11Z")

</div>

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