I am trying to perform aggregation on top aggregations results in kibana visualization tab. Can anyone please help me how to achieve this

My use case: Group the data by "a" attribute and "b" attribute. The below is the result i am able to figure out with kibana

a attribute b attribute Count
A1 x 1
A1 y 1
B1 z 2

Problem: Again i want to group the above result with "Group by 'a' attribute". Please help me achieveing this.

I'm not sure I fully understand your use case - could you show the table you would like to see with your example above?