# Kibana Sum Aggregation showing wrong result

**URL:** <https://discuss.elastic.co/t/kibana-sum-aggregation-showing-wrong-result/180598>\
**Category:** Kibana\
**Created:** [May 10, 2019, 5:28pm UTC](https://discuss.elastic.co/t/kibana-sum-aggregation-showing-wrong-result/180598 "2019-05-10T17:28:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adityaPsl](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@adityaPsl](https://discuss.elastic.co/u/adityaPsl)\
**Post date:** [May 10, 2019, 5:28pm UTC](https://discuss.elastic.co/t/kibana-sum-aggregation-showing-wrong-result/180598/1 "2019-05-10T17:28:10Z")

</div>

Hello Team,

I am trying to use kibana data-table with sum aggregation, however the sum aggregation is showing wrong result  
Please find below details.

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

Kibana data table with Sum aggregation  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/e/8e7032b206a656e0653d1e268fb7953679ffc641.png)

Actual Result :  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/d/bd13a6d96d35dd40a25ef08993221a09a5f286f4.png)

Mapping for the field largenum

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

Not sure why the sum is not getting calculated correctly.

any pointers to resolve this issue are really appreciated.

Thanks in Advance,  
Aditya

---

<div class="post-metadata">

**Author:** ![joelgriffith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joelgriffith/32/53738_2.png) [@joelgriffith](https://discuss.elastic.co/u/joelgriffith)\
**Post date:** [May 10, 2019, 9:45pm UTC](https://discuss.elastic.co/t/kibana-sum-aggregation-showing-wrong-result/180598/2 "2019-05-10T21:45:26Z")

</div>

@adityaPsl This is due to the values themselves being stored as floating-point numbers, wherein things like `sum` aggregations are going to not operate as you'd expect compared to whole numbers. I think this GH issue describes it better than I did: [https://github.com/elastic/elasticsearch/issues/30529](https://github.com/elastic/elasticsearch/issues/30529)

---

<div class="post-metadata">

**Author:** ![adityaPsl](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@adityaPsl](https://discuss.elastic.co/u/adityaPsl)\
**Post date:** [May 16, 2019, 3:53am UTC](https://discuss.elastic.co/t/kibana-sum-aggregation-showing-wrong-result/180598/3 "2019-05-16T03:53:58Z")

</div>

Thank you joelgriffith , it worked. I changed the mapping from float to double.

Thank you,  
Aditya

---

<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:** [June 13, 2019, 3:53am UTC](https://discuss.elastic.co/t/kibana-sum-aggregation-showing-wrong-result/180598/4 "2019-06-13T03:53:59Z")

</div>

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