Can we calculate percentage in kibana. I have two fields. Count and count difference. I want to aggregate based on dept and calculate (count difference/count) * 100 for the various dept buckets
Please help me
Can we calculate percentage in kibana. I have two fields. Count and count difference. I want to aggregate based on dept and calculate (count difference/count) * 100 for the various dept buckets
Please help me
You could either reindex your data to already have this field or use scripted fields to achieve the same (but it will be way slower)
to do it with scripted fields:
return 100 * doc['field1name'].value / doc['field2name'].value
some docs:
Thanks I was able to use this. Can watcher be applied to this scripted field?
i think that should be possible, however not completely sure.
I created a saved search and added a new scripted field %Count_Difference using Count_Diff and Count Field. Can that saved search be grouped by another field dept ?
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
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.