How can I make a calculation across multiple documents with a given ID?

I want to be able to add a bar chart on Kibana which displays a count of users (identified by name) which have a total of more than 0 in total_a (with total of 0 for total_b) and column for those with a total of more than 0 in total_b (with total of 0 for total_a). So the calculation needs to take place across all documents with a given name.

[{
  "name": "foo",
  "total_a": 10,
  "total_b": 0
},
{
  "name": "foo",
  "total_a": 0,
  "total_b": 10
}, 
{
  "name": "bar",
  "total_a": 50,
  "total_b": 100
}]

Is this possible?

Have you tried creating a horizontal or vertical bar chart with a split series on name and a subsequent split series using a filter aggregation that filters by your clause?
or directly a single bucket filter aggregation with name and total_a > 0 ?

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