I want to as how to write script to calculate percentage. I want to calculate percentage of every industry in every state. Main problem is that I don't know how to write specific industry in specific state in script. I know it should look something like this ((specific industry in state) * 100) /doc['industry.count'].
You would need a field in your data for the (specific industry in state) in order to script a field like this.
If you don't have it, your best option to see the calculation in Kibana would be to run a calculation on the data in an ES query, and then index the result back into your data so you can work with it in Kibana.
If your data is time-based and seeing the data in a timeseries makes sense for your use case, you can maybe try Timelion which has an expression language that lets you do some calculations on data inside time buckets.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.