Group input values in Bar Chart Aggregation

If I have documents where value.keyword = A1, value.keyword = A2 ... A3, B1, B2, B3
How would I get all of the A values to group together and B values to group together instead of having 6 separate bars on my graph?

This is using Visualization - Aggregation, not lens
Thanks

Hi Miriam. The best way to do this is by adding a new "group" field and populate this field at ingest. So your documents might look like { "value": "A1", "group": "A" }. Then you could perform the aggregation on the group field. But you'll need to update your existing documents using reindex with a pipeline to populate the group field.

A second-best way to do this, but maybe less performant, is to create a group runtime field. This involves a little scripting, but you don't need to update your existing documents.

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