# Calculating percentage of Top10 in all population with pie chart

**URL:** <https://discuss.elastic.co/t/calculating-percentage-of-top10-in-all-population-with-pie-chart/65626>\
**Category:** Kibana\
**Created:** [November 10, 2016, 10:11am UTC](https://discuss.elastic.co/t/calculating-percentage-of-top10-in-all-population-with-pie-chart/65626 "2016-11-10T10:11:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TSimkevicius](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@TSimkevicius](https://discuss.elastic.co/u/TSimkevicius)\
**Post date:** [November 10, 2016, 10:11am UTC](https://discuss.elastic.co/t/calculating-percentage-of-top10-in-all-population-with-pie-chart/65626/1 "2016-11-10T10:11:17Z")

</div>

Hello everyone.  
I'm quite new with kibana, so I can not think of a way to calculate percentage of Top10 industries in all population. Because now I am getting results like these 10 industries are all population, and it does not include other 40 industries left outside top 10. And I want that all 40 industries left outside top10 would be marked as other and their percentage would be calculated.

For Example if I calculate percentage of industries in all Population, I get that Hospital and Health care makes 6.6%

 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/966bb2a6cdaf68a0512bde176bea037e01ebced5.jpg)

And if I calculate percentage of industries for top10 it shows me that Hospital and Health care makes 19.7%

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

---

<div class="post-metadata">

**Author:** ![BigFunger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bigfunger/32/7323_2.png) [@BigFunger](https://discuss.elastic.co/u/BigFunger)\
**Post date:** [November 10, 2016, 9:00pm UTC](https://discuss.elastic.co/t/calculating-percentage-of-top10-in-all-population-with-pie-chart/65626/2 "2016-11-10T21:00:06Z")

</div>

Let me summarize to make sure I understand what you are asking for. You want a pie chart showing the top 10 terms by Count aggregation. You also want all of the other terms combined into one other aggregated count value.

If I am correct, this functionality is not currently supported in Kibana. There is an outstanding github ticket for it here: [https://github.com/elastic/kibana/issues/1961](https://github.com/elastic/kibana/issues/1961)

And to clarify why the percentages are different from the two pie charts shown above... Those percentages represent the percentage of that term in relation to the pie chart, and not to your dataset as a whole. So, when you limit the pie chart to the top 10 terms, the shown slice is 19.07% of the total of all of the slices shown.

---

<div class="post-metadata">

**Author:** ![TSimkevicius](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@TSimkevicius](https://discuss.elastic.co/u/TSimkevicius)\
**Post date:** [November 14, 2016, 10:49am UTC](https://discuss.elastic.co/t/calculating-percentage-of-top10-in-all-population-with-pie-chart/65626/3 "2016-11-14T10:49:57Z")

</div>

That's what I wanted to know. Thank you for information. Maybe you know if it is possible to do with elastisearch using script fields or something similar?

---

<div class="post-metadata">

**Author:** ![BigFunger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bigfunger/32/7323_2.png) [@BigFunger](https://discuss.elastic.co/u/BigFunger)\
**Post date:** [November 14, 2016, 3:45pm UTC](https://discuss.elastic.co/t/calculating-percentage-of-top10-in-all-population-with-pie-chart/65626/4 "2016-11-14T15:45:31Z")

</div>

I don't know if this is possible at the moment. Some attempts that other people have made to address this are detailed in the comment history of the linked issue. Maybe there is something there that will suit your needs.

---

<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:** [December 12, 2016, 3:46pm UTC](https://discuss.elastic.co/t/calculating-percentage-of-top10-in-all-population-with-pie-chart/65626/5 "2016-12-12T15:46:35Z")

</div>

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