# Kibana ~ min\_doc\_count : 0 issue with calculating percentage

**URL:** <https://discuss.elastic.co/t/kibana-min-doc-count-0-issue-with-calculating-percentage/237933>\
**Category:** Kibana\
**Created:** [June 20, 2020, 6:54pm UTC](https://discuss.elastic.co/t/kibana-min-doc-count-0-issue-with-calculating-percentage/237933 "2020-06-20T18:54:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vdalvi](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@vdalvi](https://discuss.elastic.co/u/vdalvi)\
**Post date:** [June 20, 2020, 6:54pm UTC](https://discuss.elastic.co/t/kibana-min-doc-count-0-issue-with-calculating-percentage/237933/1 "2020-06-20T18:54:53Z")

</div>

Hi,

I have a kibana query that calculates percentage change over a period of 15 minutes. The query works just fine except when the doc\_count : 0.

When I get a doc\_count : 0 for that interval it does not calculate percentage change and in the next interval I get "null" I understand the math behind it but is it possible to still calculate percentage change when doc\_count : 0 ??

Please refer to the 12:00 PM and 12:00 PM interval for reference below...  
Query Result :

```auto
"buckets" : [
        {
          "key" : "c91f8152d1e3dea4bd2c7ace418c10fbb981893c",
          "doc_count" : 138029,
          "every15min" : {
            "buckets" : [
              {
                "key_as_string" : "2020-06-20T11:30:00.000-06:00",
                "key" : 1592674200000,
                "doc_count" : 38752
              },
              {
                "key_as_string" : "2020-06-20T11:45:00.000-06:00",
                "key" : 1592675100000,
                "doc_count" : 41174,
                "significantChange" : {
                  "value" : 2422.0
                },
                "significantChangePerc" : {
                  "value" : 6.25
                }
              },
              {
                "key_as_string" : "2020-06-20T12:00:00.000-06:00",
                "key" : 1592676000000,
                "doc_count" : 0,
                "significantChange" : {
                  "value" : -41174.0
                }
              },
              {
                "key_as_string" : "2020-06-20T12:15:00.000-06:00",
                "key" : 1592676900000,
                "doc_count" : 38737,
                "significantChange" : {
                  "value" : 38737.0
                },
                "significantChangePerc" : {
                  "value" : null
                }
              },
              {
                "key_as_string" : "2020-06-20T12:30:00.000-06:00",
                "key" : 1592677800000,
                "doc_count" : 19366,
                "significantChange" : {
                  "value" : -19371.0
                },
                "significantChangePerc" : {
                  "value" : -50.006453778041674
                }
              }
            ]
          }
        }

```

As seen I dont see percentage change calculated when doc\_count: 0 I would like to see for example -100% there. Is it possible ?

---

<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 18, 2020, 6:55pm UTC](https://discuss.elastic.co/t/kibana-min-doc-count-0-issue-with-calculating-percentage/237933/2 "2020-07-18T18:55:01Z")

</div>

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