# Create metric graph, line graph with timetaken and want to group it by two fields (A, B)

**URL:** <https://discuss.elastic.co/t/create-metric-graph-line-graph-with-timetaken-and-want-to-group-it-by-two-fields-a-b/251730>\
**Category:** Kibana\
**Created:** [October 12, 2020, 8:37am UTC](https://discuss.elastic.co/t/create-metric-graph-line-graph-with-timetaken-and-want-to-group-it-by-two-fields-a-b/251730 "2020-10-12T08:37:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lata\_Pukale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lata_pukale/32/76928_2.png) [@Lata\_Pukale](https://discuss.elastic.co/u/Lata_Pukale)\
**Post date:** [October 12, 2020, 8:37am UTC](https://discuss.elastic.co/t/create-metric-graph-line-graph-with-timetaken-and-want-to-group-it-by-two-fields-a-b/251730/1 "2020-10-12T08:37:17Z")

</div>

I want to get metric and line graph visualization where it displays average timetaken by A and B where values of A can be ac,au ,ad and B can be bs,bc,bu  
So when I try to get metric visualization with Metric  
Average TimeTaken and Buckets with Split group -\> Aggregation -\> A  
I get three value but here I want to split group again by B value as well.  
Can anyone suggest how to proceed

And same is happening with line graph where get Y-Axis as Average TimeTaken and X-Axis as per day ,  
I did add split series for A field .

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [October 12, 2020, 11:07pm UTC](https://discuss.elastic.co/t/create-metric-graph-line-graph-with-timetaken-and-want-to-group-it-by-two-fields-a-b/251730/2 "2020-10-12T23:07:24Z")

</div>

Hi @Lata_Pukale. I could use some more information. Can you provide me an example of the A and B documents in Elasticsearch?

---

<div class="post-metadata">

**Author:** ![Lata\_Pukale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lata_pukale/32/76928_2.png) [@Lata\_Pukale](https://discuss.elastic.co/u/Lata_Pukale)\
**Post date:** [October 13, 2020, 5:38am UTC](https://discuss.elastic.co/t/create-metric-graph-line-graph-with-timetaken-and-want-to-group-it-by-two-fields-a-b/251730/3 "2020-10-13T05:38:24Z")

</div>

Yes sure. It's quiet simple as  
Consider my search table with columns TimeTaken, Action and RecordType  
And the values in them is Timetaken in seconds, Action can be ac,au or ad And RecordType can be bs, bc and bu

Timetaken, Action, RecordType  
20 ac bs  
50 au bc  
20 ad bu  
11 ac bc

Now I want to get Average TimeTaken by Action and its Recordtype for daily entries that I get

So I did create Line Chart with Y-Axis as Average TimeTaken  
And X-Axis Date  
And then split graph with Action  
But I get average timetaken for only Action

How to get it for Action and Record

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [October 16, 2020, 6:38pm UTC](https://discuss.elastic.co/t/create-metric-graph-line-graph-with-timetaken-and-want-to-group-it-by-two-fields-a-b/251730/4 "2020-10-16T18:38:32Z")

</div>

Hi Looby, I think this is too complex for a Metric visualization. Maybe you need to look at using TSVB? It has advanced capabilities that may support this.

---

<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:** [November 13, 2020, 6:38pm UTC](https://discuss.elastic.co/t/create-metric-graph-line-graph-with-timetaken-and-want-to-group-it-by-two-fields-a-b/251730/5 "2020-11-13T18:38:42Z")

</div>

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