# Data table visualization - display other value then matric value

**URL:** https://discuss.elastic.co/t/data-table-visualization-display-other-value-then-matric-value/136465
**Category:** Kibana
**Created:** [June 19, 2018, 10:24am UTC](https://discuss.elastic.co/t/data-table-visualization-display-other-value-then-matric-value/136465 "2018-06-19T10:24:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Shneor\_Asa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shneor_asa/32/32416_2.png) [@Shneor\_Asa](https://discuss.elastic.co/u/Shneor_Asa)
#### Post date: [June 19, 2018, 10:24am UTC](https://discuss.elastic.co/t/data-table-visualization-display-other-value-then-matric-value/136465/1 "2018-06-19T10:24:27Z")

</div>

Hi,  
I have a question, how can i display some value on data table visualization based on other field matric?  
For example I have Max matric on 'date' field  
But i want to display some other value from the Document returned by metric.

---

<div class="post-metadata">

### Author: ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)
#### Post date: [June 19, 2018, 2:30pm UTC](https://discuss.elastic.co/t/data-table-visualization-display-other-value-then-matric-value/136465/2 "2018-06-19T14:30:33Z")

</div>

Hi,

I am not sure I understand your question? But this is an example of how you can use the data table visualization.

I am doing a max(metric aggregation) on bytes and splitting it over buckets of terms.

![16%20AM](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4a5ec035cd499e3153e6d4d59773615cfbf21f02.jpg)

![20%20AM](https://us1.discourse-cdn.com/elastic/original/3X/7/0/70bb44d2eecaff3b3ddeefc9d0b409820da705c8.jpg)

This is our documentation on data table aggregation: [https://www.elastic.co/guide/en/kibana/6.2/data-table.html](https://www.elastic.co/guide/en/kibana/6.2/data-table.html)

Also this video explains how Kibana uses ES aggregations: [https://www.youtube.com/watch?v=j-eCKDhj-Os](https://www.youtube.com/watch?v=j-eCKDhj-Os)

Let me know if this helps?

Thanks,  
Bhavya

---

<div class="post-metadata">

### Author: ![Shneor\_Asa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shneor_asa/32/32416_2.png) [@Shneor\_Asa](https://discuss.elastic.co/u/Shneor_Asa)
#### Post date: [June 19, 2018, 2:57pm UTC](https://discuss.elastic.co/t/data-table-visualization-display-other-value-then-matric-value/136465/3 "2018-06-19T14:57:23Z")

</div>

Hi  
let me rephrase...

lets say i have metric aggregation by Max on timestamp.  
and i also have bucket aggregation by terms of some string field  
So now i have a table of data which every row is group of documents that show the Max value of timestamp. am i right?

my question is, there is a way to get the specific document that hold the max value of timestamp within the group?

because i want display some other field's value in the specific document that have the Max value of 'timestamp' key.

right now i don't know how, because buckets are groups of documents, and I need a single one. the one who have the Max value of 'timestamp' in the bucket.

i hope this is more clearer.

thanks!

---

<div class="post-metadata">

### Author: ![Shneor\_Asa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shneor_asa/32/32416_2.png) [@Shneor\_Asa](https://discuss.elastic.co/u/Shneor_Asa)
#### Post date: [June 24, 2018, 1:39pm UTC](https://discuss.elastic.co/t/data-table-visualization-display-other-value-then-matric-value/136465/4 "2018-06-24T13:39:28Z")

</div>

any idea?

---

<div class="post-metadata">

### Author: ![Shneor\_Asa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shneor_asa/32/32416_2.png) [@Shneor\_Asa](https://discuss.elastic.co/u/Shneor_Asa)
#### Post date: [June 25, 2018, 9:11am UTC](https://discuss.elastic.co/t/data-table-visualization-display-other-value-then-matric-value/136465/5 "2018-06-25T09:11:14Z")

</div>

I know how to do it by query,

POST automationmonitoring/\_doc/\_search  
{  
"size": 0,  
"aggs": {  
"by\_district": {  
"terms": {  
"field": "description.keyword",  
"size": 50  
},  
"aggs": {  
"max\_date": {  
"max": {  
"field": "timestamp"  
}  
},  
"include\_source": {  
"top\_hits": {  
"size": 1,  
"\_source": {  
"includes": [  
"successrate"  
]  
}  
}  
}  
}  
}  
}  
}

So, all i need now is to figure out how to do that on dashboard visualization.  
Any suggestions?

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: [July 23, 2018, 9:11am UTC](https://discuss.elastic.co/t/data-table-visualization-display-other-value-then-matric-value/136465/6 "2018-07-23T09:11:15Z")

</div>

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