# Aggregating using sum always yields me zero even when there is a value associated to it

**URL:** <https://discuss.elastic.co/t/aggregating-using-sum-always-yields-me-zero-even-when-there-is-a-value-associated-to-it/60638>\
**Category:** Kibana\
**Created:** [September 15, 2016, 6:47pm UTC](https://discuss.elastic.co/t/aggregating-using-sum-always-yields-me-zero-even-when-there-is-a-value-associated-to-it/60638 "2016-09-15T18:47:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshay\_Iyangar](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@Akshay\_Iyangar](https://discuss.elastic.co/u/Akshay_Iyangar)\
**Post date:** [September 15, 2016, 6:47pm UTC](https://discuss.elastic.co/t/aggregating-using-sum-always-yields-me-zero-even-when-there-is-a-value-associated-to-it/60638/1 "2016-09-15T18:47:51Z")

</div>

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

As you can see i can see values in my discover tab.  
The problem arises when i try using aggregation trying to sum the value. It is always zero for some reason. The response returned is zero by elasticsearch for the aggregation thus i guess ES search is not able to aggregate it properly for some reason and kibana pics just what ES sends it. is there a way i can make ES pick the sum of values.?

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

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [September 16, 2016, 6:31am UTC](https://discuss.elastic.co/t/aggregating-using-sum-always-yields-me-zero-even-when-there-is-a-value-associated-to-it/60638/2 "2016-09-16T06:31:34Z")

</div>

Are the values in the screenshot of the Discover tab of the `dcr.ecomm_stargrade_dev-*` index?

---

<div class="post-metadata">

**Author:** ![Akshay\_Iyangar](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@Akshay\_Iyangar](https://discuss.elastic.co/u/Akshay_Iyangar)\
**Post date:** [September 16, 2016, 7:49am UTC](https://discuss.elastic.co/t/aggregating-using-sum-always-yields-me-zero-even-when-there-is-a-value-associated-to-it/60638/3 "2016-09-16T07:49:22Z")

</div>

Yes those are the metrics from thst topic dcr.ecomm\_stargrade\_dev-\*  
Also forgot to mention the mapping of all fields are as double.

---

<div class="post-metadata">

**Author:** ![Akshay\_Iyangar](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@Akshay\_Iyangar](https://discuss.elastic.co/u/Akshay_Iyangar)\
**Post date:** [September 19, 2016, 11:02pm UTC](https://discuss.elastic.co/t/aggregating-using-sum-always-yields-me-zero-even-when-there-is-a-value-associated-to-it/60638/4 "2016-09-19T23:02:45Z")

</div>

Issue is resolved . Grok was sending the metric as a string and ES was indexing it as a string even if it was mapped to double . So need to make sure that ES receives the field as a float.

---

<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, 1:38pm UTC](https://discuss.elastic.co/t/aggregating-using-sum-always-yields-me-zero-even-when-there-is-a-value-associated-to-it/60638/5 "2017-07-06T13:38:44Z")

</div>


