# Kibana Data Table to group by fields

**URL:** <https://discuss.elastic.co/t/kibana-data-table-to-group-by-fields/218232>\
**Category:** Kibana\
**Created:** [February 6, 2020, 5:58pm UTC](https://discuss.elastic.co/t/kibana-data-table-to-group-by-fields/218232 "2020-02-06T17:58:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_Mak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_mak/32/42230_2.png) [@Joseph\_Mak](https://discuss.elastic.co/u/Joseph_Mak)\
**Post date:** [February 6, 2020, 5:58pm UTC](https://discuss.elastic.co/t/kibana-data-table-to-group-by-fields/218232/1 "2020-02-06T17:58:08Z")

</div>

If I have something super simple like this, a bunch of records with a few fields and a timestamp.  
Is there a way to build a Data Table (or some other visualization), grouping by each of the fields?

For example, in the following simple data,  
I like to see what are my average for each field, "a","b","c" given a period of time range.  
The "bucket" seems to be working for a specific field only as far as I can see.

{  
"a":1,  
"b":2,  
"c":3,  
"d":4,  
"e":5,  
"f":6,  
"@timeStamp":"2020-02-03"  
}

Formatted JSON Data  
{  
"a":7,  
"b":8,  
"c":9,  
"d":10,  
"e":11,  
"f":12,  
"@timeStamp":"2020-02-04"  
}

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [February 7, 2020, 8:45am UTC](https://discuss.elastic.co/t/kibana-data-table-to-group-by-fields/218232/2 "2020-02-07T08:45:13Z")

</div>

Not sure whether this is what you mean, but when you are creating the data table, you can define multiple metrics. Simply add one average aggregation for each of the fields you want to show.

 ![Screenshot 2020-02-07 at 09.43.05](https://us1.discourse-cdn.com/elastic/original/3X/a/f/af766346eca4b46ccd83334ba79e3daf58fe0e5f.png)

The "bucket" aggregation is splitting the rows into 3hour intervals, but you can also omit that if you just want the metric over the whole time.

If you want another visualization could you show how the desired result would look like for your sample data?

---

<div class="post-metadata">

**Author:** ![Joseph\_Mak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_mak/32/42230_2.png) [@Joseph\_Mak](https://discuss.elastic.co/u/Joseph_Mak)\
**Post date:** [February 7, 2020, 4:15pm UTC](https://discuss.elastic.co/t/kibana-data-table-to-group-by-fields/218232/3 "2020-02-07T16:15:52Z")

</div>

Ok thank you!

---

<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:** [March 6, 2020, 4:16pm UTC](https://discuss.elastic.co/t/kibana-data-table-to-group-by-fields/218232/4 "2020-03-06T16:16:01Z")

</div>

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