Good evening, i'm trying to make a simple average but maybe i'm focused on a wrong way that is been leading me astray.
I'm using Kibana to show some productivity data coming from a industrial production plant.
I've in elasticsearch all the orders processed with the total pieces produced and the total time duration of order.
Now, viewing data in kibana dashboard also with some scripted fields works good but i need to make a productivity average on the documents selected by dashboard filters.
For example orders of today:
- Order num 1 - 100 pieces - 20 minutes
- Order num 2 - 200 pieces - 30 minutes
- Order num 3 - 100 pieces - 25 minutes
If i create a scripted fields that calculates the piecese/minutes it works good but it's not the data i want. I need to make the sum of piecese and the sum of time and calculate average over it.
What is the best way to do this?
Thank's in advance for your help!