Deviation of 20% or more of the average value

ES and Kibana version: 6.8
I have some document in an index like (only showing _source field for simplicity):

{
    "name": "unique1",
    "amount": 200
},
{
    "name": "unique1",
    "amount": 100
},
{
    "name": "unique1",
    "amount": 150
},
{
    "name": "unique2",
    "amount": 300
}

For each name, I want to find all the amounts that deviates more than or equal to 20% from their avg. In the example above, I want to see the amount 200 and 100 because that deviates more than 20% of their avg, which is 150.

How can I create a data table with these constraints?

Hi @tamjid
I'm sorry for the very late reply, was you able to solve the issue by your own?
If so, it will be great if you can post the solution there, if not I'm more then happy to help you on this

Thank you

Hi @markov00, thank you for your reply. I' de very much appreciate your help on this as it is not resolved yet.

Thanks

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