# How can I represent the most recurring document in a Kibana table?

**URL:** https://discuss.elastic.co/t/how-can-i-represent-the-most-recurring-document-in-a-kibana-table/343288
**Category:** Kibana
**Created:** [September 18, 2023, 6:46pm UTC](https://discuss.elastic.co/t/how-can-i-represent-the-most-recurring-document-in-a-kibana-table/343288 "2023-09-18T18:46:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![KristinaRaja](https://avatars.discourse-cdn.com/v4/letter/k/b9bd4f/32.png) [@KristinaRaja](https://discuss.elastic.co/u/KristinaRaja)
#### Post date: [September 18, 2023, 6:46pm UTC](https://discuss.elastic.co/t/how-can-i-represent-the-most-recurring-document-in-a-kibana-table/343288/1 "2023-09-18T18:46:56Z")

</div>

We are using an aggregated based kibana table that displays a bunch of users who had poor calls and where the majority of those poor calls took place, etc...(the user is set as the bucket).

For each user, we would like to display the "top" location, call type and connection type used for those poor calls.

I initially thought that we could use the "top hit" aggregation to display the most recurring document for each of those fields but I think it's only displaying the most recent document for each of those fields.

Is there a way to achieve what we want to do?

 ![InkedScreenshot_94](https://us1.discourse-cdn.com/elastic/original/3X/6/a/6a00d23da93f14f9adea63f3ac282112a712834d.jpeg)

---

<div class="post-metadata">

### Author: ![sholzhauer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sholzhauer/32/110282_2.png) [@sholzhauer](https://discuss.elastic.co/u/sholzhauer)
#### Post date: [September 19, 2023, 7:32pm UTC](https://discuss.elastic.co/t/how-can-i-represent-the-most-recurring-document-in-a-kibana-table/343288/2 "2023-09-19T19:32:03Z")

</div>

I believe you are looking for an additional bucket in your scenario.  
If you add a second bucket where you split the row on the location you'll get something like this:

| user | count | location | location type | etc |
| --- | --- | --- | --- | --- |
| john | 5 | Chigago | alpha | x |
| john | 3 | NY | alpha | x |
| mary | 3 | LA | alpha | x |

Where `john` has a total of 5+3=8 counts and was the most observer in the chicago location.

Is this what you are looking for?

---

<div class="post-metadata">

### Author: ![KristinaRaja](https://avatars.discourse-cdn.com/v4/letter/k/b9bd4f/32.png) [@KristinaRaja](https://discuss.elastic.co/u/KristinaRaja)
#### Post date: [September 21, 2023, 1:44pm UTC](https://discuss.elastic.co/t/how-can-i-represent-the-most-recurring-document-in-a-kibana-table/343288/3 "2023-09-21T13:44:37Z")

</div>

This brings me closer to what I was trying to achieve, thanks!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 19, 2023, 1:44pm UTC](https://discuss.elastic.co/t/how-can-i-represent-the-most-recurring-document-in-a-kibana-table/343288/4 "2023-10-19T13:44:41Z")

</div>

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