Calculating percentage of Top10 in all population with pie chart

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%

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

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

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.

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?

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.

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