# Sum to 0 when values are too small

**URL:** <https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331>\
**Category:** Kibana\
**Created:** [August 13, 2015, 1:58pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331 "2015-08-13T13:58:43Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gilles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilles/32/4175_2.png) [@Gilles](https://discuss.elastic.co/u/Gilles)\
**Post date:** [August 13, 2015, 1:58pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/1 "2015-08-13T13:58:43Z")

</div>

Hello,  
Is there a minimum value to have a non null sum?  
I have a field with numeric values in the 10\*\*-2 but all my graphs charts are at 0

Thanks

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [August 14, 2015, 5:15pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/2 "2015-08-14T17:15:23Z")

</div>

Could you include a couple of source documents and a screenshot of the resulting visualization?

---

<div class="post-metadata">

**Author:** ![Gilles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilles/32/4175_2.png) [@Gilles](https://discuss.elastic.co/u/Gilles)\
**Post date:** [August 18, 2015, 9:23am UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/3 "2015-08-18T09:23:14Z")

</div>

Sure can; I attached a couple of screenshots of the logstash values of the mdc.stats.time\_in\_bloomd variable, you can see regularly values greater than zero; the corresponding line chart graph suming that variable shows most of the values at zero (the pikes have also zero has value). Is there some rounding, variable type issue??

Similarly the chart graph suming another variable with similar range of values (decimal between 0 an 1) keeps switching from 0 to 1 with no intermediate values.

Thanks

Regards

 ![](https://us1.discourse-cdn.com/elastic/original/2X/f/fbb66c25de72b5647e732326c945ef4d96e46f5d.png)

 ![](https://us1.discourse-cdn.com/elastic/original/2X/7/7228adf2609b624d606307c5e08be8e569297f7b.png)

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [August 18, 2015, 4:17pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/4 "2015-08-18T16:17:27Z")

</div>

Perfect, could you click on the spy to show me what data is behind the visualization #2 you posted above? (see in red on your screenshot)

 ![](https://us1.discourse-cdn.com/elastic/original/2X/8/82cbcb9d548054cb262606d47f7909a25734e06f.png)

---

<div class="post-metadata">

**Author:** ![Gilles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilles/32/4175_2.png) [@Gilles](https://discuss.elastic.co/u/Gilles)\
**Post date:** [August 19, 2015, 7:44am UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/5 "2015-08-19T07:44:58Z")

</div>

Hello,  
Thanks for the suggestion; I did open the spy, and everything is at 0 (I perused through the whole data), odd isn't it?; partial screen shot below....

Cheers

 ![](https://us1.discourse-cdn.com/elastic/original/2X/d/de69e9b3bb495a9d036905d7c7003c4b00494e10.png)

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [August 20, 2015, 4:37am UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/6 "2015-08-20T04:37:49Z")

</div>

This means that zeros are stored in Elasticsearch and returned to the UI... Kibana is just displaying what's being stored.

---

<div class="post-metadata">

**Author:** ![Gilles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilles/32/4175_2.png) [@Gilles](https://discuss.elastic.co/u/Gilles)\
**Post date:** [August 20, 2015, 8:21am UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/7 "2015-08-20T08:21:36Z")

</div>

Hello, thanks for your answer; but that is precisely my issue as I have none zero values for that variable as is shown in the first screen shot (values are small but not zeros)...

Also, if values are all zeros, why is the line chart graph displaying these pikes (which values are at zero in the spy).

I have other line chart graphs for which the summation is displayed correctly with small and many zero values.

I attached a new screen shot showing the non zero values for the culprit variable.

Thanks

 ![](https://us1.discourse-cdn.com/elastic/original/2X/b/b0f84f4e4f1082721ce2a1873e44692eaeeee39a.png)

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [August 20, 2015, 9:21pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/8 "2015-08-20T21:21:10Z")

</div>

The Table is displaying the first 10 values, and from the chart those may well be zero. Could you zoom in on one of the spikes, capturing the first zero values and the larger values and share the chart with the spy open? Also, feel free to share the JSON behind one of the sample documents, so one of us could play with it directly.

---

<div class="post-metadata">

**Author:** ![Gilles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilles/32/4175_2.png) [@Gilles](https://discuss.elastic.co/u/Gilles)\
**Post date:** [August 21, 2015, 1:37pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/9 "2015-08-21T13:37:30Z")

</div>

Thanks for your patience; attached the screen shot of the zoom in for first non zero value (0.039) for the variable (mdc.stats.time\_in\_bloomd) for the considered time period, and below the corresponding json code:

{  
"\_index": "logstash-2015.08.20",  
"\_type": "syslog",  
"\_id": "AU9LbRMVJhkp33JJWFPy",  
"\_score": 1,  
"\_source": {  
"message": "\<182\>Aug 20 14:05:08 compute-1 /usr/local/perl-dists/perls/perl @cee: {"msg":"Account 261622 done","webo\_env":"PREPROD","time":1440079508,"subsys":"Weborama::Advertiser::Compute::StatComputation","pname":"advertiser-compute.pl","mdc":{"wcm.unicity.time":0.104957,"stats.time\_in\_ring.write":0,"wcm.users.huge":0,"wcm.db.flat\_conv.write":3.5e-05,"stats.time\_in\_ring.read":0.062427,"product.project":"Weborama::Advertiser::Compute","wcm.country":"France","stats.compute\_time":18.6675,"stats.time\_in\_ring":0.062427,"parameters.account\_id":261622,"wcm.unicity.calls":36,"wcm.users.total":23,"stats.time\_in\_redis.read":0.121336,"wcm.actions.total":169,"wcm.users.ring":1,"stats.time\_in\_redis":0.210939,"wcm.profils.ring":4,"stats.time\_in\_redis.write":0.089603,"stats.impression":22,"wcm.users.undef":14,"stats.time\_in\_bloomd":0.039323,"wcm.profils.redis":23,"wcm.users.spiders":0,"wcm.users.redis":8,"product":"WCM","stats.click":2,"stats.time\_in\_sql.write":5.642948},"pri":"INFO","host":"compute-1"}\n",  
"@version": "1",  
"@timestamp": "2015-08-20T14:04:43.654Z",  
"type": "syslog",  
"host": "compute-1",  
"tags": [  
"\_grokparsefailure\_sysloginput",  
"weborama"  
],  
"priority": 0,  
"severity": 0,  
"facility": 0,  
"facility\_label": "kernel",  
"severity\_label": "Emergency",  
"json\_log": "{"msg":"Account 261622 done","webo\_env":"PREPROD","time":1440079508,"subsys":"Weborama::Advertiser::Compute::StatComputation","pname":"advertiser-compute.pl","mdc":{"wcm.unicity.time":0.104957,"stats.time\_in\_ring.write":0,"wcm.users.huge":0,"wcm.db.flat\_conv.write":3.5e-05,"stats.time\_in\_ring.read":0.062427,"product.project":"Weborama::Advertiser::Compute","wcm.country":"France","stats.compute\_time":18.6675,"stats.time\_in\_ring":0.062427,"parameters.account\_id":261622,"wcm.unicity.calls":36,"wcm.users.total":23,"stats.time\_in\_redis.read":0.121336,"wcm.actions.total":169,"wcm.users.ring":1,"stats.time\_in\_redis":0.210939,"wcm.profils.ring":4,"stats.time\_in\_redis.write":0.089603,"stats.impression":22,"wcm.users.undef":14,"stats.time\_in\_bloomd":0.039323,"wcm.profils.redis":23,"wcm.users.spiders":0,"wcm.users.redis":8,"product":"WCM","stats.click":2,"stats.time\_in\_sql.write":5.642948},"pri":"INFO","host":"compute-1"}\n",  
"msg": "Account 261622 done",  
"webo\_env": "PREPROD",  
"time": 1440079508,  
"subsys": "Weborama::Advertiser::Compute::StatComputation",  
"pname": "advertiser-compute.pl",  
"mdc": {  
"wcm.unicity.time": 0.104957,  
"stats.time\_in\_ring.write": 0,  
"wcm.users.huge": 0,  
"wcm.db.flat\_conv.write": 0.000035,  
"stats.time\_in\_ring.read": 0.062427,  
"product.project": "Weborama::Advertiser::Compute",  
"wcm.country": "France",  
"stats.compute\_time": 18.6675,  
"stats.time\_in\_ring": 0.062427,  
"parameters.account\_id": 261622,  
"wcm.unicity.calls": 36,  
"wcm.users.total": 23,  
"stats.time\_in\_redis.read": 0.121336,  
"wcm.actions.total": 169,  
"wcm.users.ring": 1,  
"stats.time\_in\_redis": 0.210939,  
"wcm.profils.ring": 4,  
"stats.time\_in\_redis.write": 0.089603,  
"stats.impression": 22,  
"wcm.users.undef": 14,  
"stats.time\_in\_bloomd": 0.039323,  
"wcm.profils.redis": 23,  
"wcm.users.spiders": 0,  
"wcm.users.redis": 8,  
"product": "WCM",  
"stats.click": 2,  
"stats.time\_in\_sql.write": 5.642948  
},  
"pri": "INFO"  
},  
"fields": {  
"compute time per hit": [  
0  
],  
"@timestamp": [  
1440079483654  
],  
"returning user count": [  
0  
]  
}  
}

 ![](https://us1.discourse-cdn.com/elastic/original/2X/f/f89faae0a5363cd3e4925b0b152ad462d91ff6f3.png)

---

<div class="post-metadata">

**Author:** ![Gilles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilles/32/4175_2.png) [@Gilles](https://discuss.elastic.co/u/Gilles)\
**Post date:** [August 21, 2015, 1:37pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/10 "2015-08-21T13:37:47Z")

</div>

Conversely, the json code for a 0 value:

{  
"\_index": "logstash-2015.08.21",  
"\_type": "syslog",  
"\_id": "AU9QX45uJhkp33JJWNtf",  
"\_score": null,  
"\_source": {  
"message": "\<182\>Aug 21 13:08:28 compute-2 /usr/local/perl-dists/perls/perl @cee: {"msg":"Account 261805 done","webo\_env":"PREPROD","time":1440162508,"subsys":"Weborama::Advertiser::Compute::StatComputation","pname":"advertiser-compute.pl","mdc":{"wcm.unicity.time":0,"stats.time\_in\_ring.write":0,"wcm.users.huge":0,"wcm.db.flat\_conv.write":2.5e-05,"stats.time\_in\_ring.read":0,"product.project":"Weborama::Advertiser::Compute","wcm.country":"Colombia","stats.compute\_time":2.496746,"stats.time\_in\_ring":0,"parameters.account\_id":261805,"wcm.unicity.calls":0,"wcm.users.total":0,"stats.time\_in\_redis.read":0.000733,"wcm.actions.total":0,"wcm.users.ring":0,"stats.time\_in\_redis":0.001508,"wcm.profils.ring":0,"stats.time\_in\_redis.write":0.000775,"wcm.users.undef":0,"stats.time\_in\_bloomd":0,"wcm.profils.redis":0,"wcm.users.spiders":0,"wcm.users.redis":0,"product":"WCM","stats.time\_in\_sql.write":0.000118},"pri":"INFO","host":"compute-2"}\n",  
"@version": "1",  
"@timestamp": "2015-08-21T13:08:03.699Z",  
"type": "syslog",  
"host": "compute-2",  
"tags": [  
"\_grokparsefailure\_sysloginput",  
"weborama"  
],  
"priority": 0,  
"severity": 0,  
"facility": 0,  
"facility\_label": "kernel",  
"severity\_label": "Emergency",  
"json\_log": "{"msg":"Account 261805 done","webo\_env":"PREPROD","time":1440162508,"subsys":"Weborama::Advertiser::Compute::StatComputation","pname":"advertiser-compute.pl","mdc":{"wcm.unicity.time":0,"stats.time\_in\_ring.write":0,"wcm.users.huge":0,"wcm.db.flat\_conv.write":2.5e-05,"stats.time\_in\_ring.read":0,"product.project":"Weborama::Advertiser::Compute","wcm.country":"Colombia","stats.compute\_time":2.496746,"stats.time\_in\_ring":0,"parameters.account\_id":261805,"wcm.unicity.calls":0,"wcm.users.total":0,"stats.time\_in\_redis.read":0.000733,"wcm.actions.total":0,"wcm.users.ring":0,"stats.time\_in\_redis":0.001508,"wcm.profils.ring":0,"stats.time\_in\_redis.write":0.000775,"wcm.users.undef":0,"stats.time\_in\_bloomd":0,"wcm.profils.redis":0,"wcm.users.spiders":0,"wcm.users.redis":0,"product":"WCM","stats.time\_in\_sql.write":0.000118},"pri":"INFO","host":"compute-2"}\n",  
"msg": "Account 261805 done",  
"webo\_env": "PREPROD",  
"time": 1440162508,  
"subsys": "Weborama::Advertiser::Compute::StatComputation",  
"pname": "advertiser-compute.pl",  
"mdc": {  
"wcm.unicity.time": 0,  
"stats.time\_in\_ring.write": 0,  
"wcm.users.huge": 0,  
"wcm.db.flat\_conv.write": 0.000025,  
"stats.time\_in\_ring.read": 0,  
"product.project": "Weborama::Advertiser::Compute",  
"wcm.country": "Colombia",  
"stats.compute\_time": 2.496746,  
"stats.time\_in\_ring": 0,  
"parameters.account\_id": 261805,  
"wcm.unicity.calls": 0,  
"wcm.users.total": 0,  
"stats.time\_in\_redis.read": 0.000733,  
"wcm.actions.total": 0,  
"wcm.users.ring": 0,  
"stats.time\_in\_redis": 0.001508,  
"wcm.profils.ring": 0,  
"stats.time\_in\_redis.write": 0.000775,  
"wcm.users.undef": 0,  
"stats.time\_in\_bloomd": 0,  
"wcm.profils.redis": 0,  
"wcm.users.spiders": 0,  
"wcm.users.redis": 0,  
"product": "WCM",  
"stats.time\_in\_sql.write": 0.000118  
},  
"pri": "INFO"  
},  
"fields": {  
"compute time per hit": [  
0  
],  
"@timestamp": [  
1440162483699  
],  
"returning user count": [  
0  
]  
},  
"sort": [  
1440162483699  
]  
}

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [August 22, 2015, 2:54pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/11 "2015-08-22T14:54:44Z")

</div>

I tested this out using my own data, and I'm getting similarly strange results as you. I filed a bug in the Github repo for Kibana, feel free to add your comments there, if I failed to capture something from your use case: [https://github.com/elastic/kibana/issues/4736](https://github.com/elastic/kibana/issues/4736)

As a workaround, you may want to consider scaling your data using scripted fields for now. Also, consider using square root axis scaling for your Y-axis, if you have large order of magnitude differences in the data points.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/5/5e727b0abed39e09d3e05faf96be38b7cca37ad8.png)

 ![](https://us1.discourse-cdn.com/elastic/original/2X/6/665c4bb4dcfc6c4373da670947fc68d7dd36d874.png)

---

<div class="post-metadata">

**Author:** ![Gilles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilles/32/4175_2.png) [@Gilles](https://discuss.elastic.co/u/Gilles)\
**Post date:** [August 24, 2015, 2:30pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/12 "2015-08-24T14:30:21Z")

</div>

Great, you summed it up perfectly; we'll probably end up scaling the data.

Regards

---

<div class="post-metadata">

**Author:** ![Gilles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilles/32/4175_2.png) [@Gilles](https://discuss.elastic.co/u/Gilles)\
**Post date:** [August 25, 2015, 12:02pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/13 "2015-08-25T12:02:13Z")

</div>

Just in case it can bring some light on the issue; we can also observe, for the same key and the same value range in Discover, an opposite behaviour with values overblown in Visualization !!! (see screen shot)

Regards

 ![](https://us1.discourse-cdn.com/elastic/original/2X/a/a7baf42c63506e4f8fdda76eadbfda274794c80c.png)

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [August 25, 2015, 1:40pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/14 "2015-08-25T13:40:55Z")

</div>

One of the devs replied to the ticket, and it appears that in the case of small numbers one way to address it is with field formatters. Could you give it a try for unscaled numbers? Should work in Kibana 4.1+

 ![](https://us1.discourse-cdn.com/elastic/original/2X/8/84278d2f364d9f2b61fbaa9e56bbc6c345694c60.png)

 ![](https://us1.discourse-cdn.com/elastic/original/2X/5/57b72a32a1a36105f5d9ee05e214128ff7c52506.png)

---

<div class="post-metadata">

**Author:** ![Gilles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilles/32/4175_2.png) [@Gilles](https://discuss.elastic.co/u/Gilles)\
**Post date:** [August 28, 2015, 9:33am UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/15 "2015-08-28T09:33:46Z")

</div>

Hello, I tried but that did not do the trick; though the data have now plenty of digits in Discover (see SS, right most column), the sum in the Visualize graphs remains the same (0 or 1).

Checking on the Elasticsearch response, I can see that all the values are retrieved by Elasticsearch incorrectly.... so it looks more like an Elasticsearch issue than Kibana one...

I also created a scripted field, multiplying the initial faulty key by 1000, that retrieves values of 0 or 1000 (same way than I had 0 or 1 with the initial key) in the Visualize graphs, though Discover is really out of whack with out of range values (see SS, first column).

Hope this helps

Thanks

 ![](https://us1.discourse-cdn.com/elastic/original/2X/7/7ea7836c4ec704e33dbe17c535a4773e62adda8b.png)

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [August 28, 2015, 1:22pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/16 "2015-08-28T13:22:41Z")

</div>

It may be an Elasticsearch issue, but as mentioned previously, I personally cannot replicate it. Could you post a combo screenshot of both your vis config and the values behind the vis, like below, that consists of no more than 10 points you're trying to visualize?

 ![](https://us1.discourse-cdn.com/elastic/original/2X/e/e934a0dd63c5a702ce1c6cf2c6b67751ac32c39b.png)

---

<div class="post-metadata">

**Author:** ![Gilles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilles/32/4175_2.png) [@Gilles](https://discuss.elastic.co/u/Gilles)\
**Post date:** [August 28, 2015, 2:08pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/17 "2015-08-28T14:08:39Z")

</div>

Hope this helps....

Thanks

From your reply of 6 days ago I understood that you were able to reproduce the issue tough....

 ![](https://us1.discourse-cdn.com/elastic/original/2X/8/8c809e49d91ec12e7f9064c6a6f76911b1059f49.png)

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [September 1, 2015, 2:52am UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/18 "2015-09-01T02:52:14Z")

</div>

Yes, but the field formatter trick discussed in the Github ticket clears up the problem with the sample use case I tried.

---

<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 6, 2017, 2:14pm UTC](https://discuss.elastic.co/t/sum-to-0-when-values-are-too-small/27331/19 "2017-07-06T14:14:01Z")

</div>


