# Visualize data by two fields

**URL:** <https://discuss.elastic.co/t/visualize-data-by-two-fields/316819>\
**Category:** Kibana\
**Created:** [October 17, 2022, 6:18pm UTC](https://discuss.elastic.co/t/visualize-data-by-two-fields/316819 "2022-10-17T18:18:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kohlman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kohlman/32/87348_2.png) [@Kohlman](https://discuss.elastic.co/u/Kohlman)\
**Post date:** [October 17, 2022, 6:18pm UTC](https://discuss.elastic.co/t/visualize-data-by-two-fields/316819/1 "2022-10-17T18:18:49Z")

</div>

We have multiple clients. Each client has there own instance of our database. While there may be subtle differences in schema as we continue to make enhancements. For purposes of this question we can assume they are the same.

I would like to see which are the largest tables across all the clients. We use metricbeat to pull out data like size of the DB, size of every table etc. If I create a visualization and aggregate by table name . . . it will show me which table is the largest across the sum of all the database instances. What I want to see is which table is largest by client DB and table name. Luckily the db names are all different.

The two ways I can think to solve this are:

- create a new field in elastic and concatenate the values of the db\_name & table\_name
- modify the SQL metricbeat uses and add another field where I return the concatenated value of the db\_name & table\_name. This seems to be preferable given the cost of the dynamic field in elastic.

I'm an SQL person. This concept in SQL is as straight forwards as it gets. However, when I try to create a visualization I can add both the db\_name and the table\_tame as something I want to see, but they are essentially independent. Is there a 3rd way to solve this that I am missing?

Thanks,  
Kohlman

---

<div class="post-metadata">

**Author:** ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)\
**Post date:** [October 18, 2022, 6:54am UTC](https://discuss.elastic.co/t/visualize-data-by-two-fields/316819/2 "2022-10-18T06:54:56Z")

</div>

Hey! Can you share with me which version of kibana you are using? Also are you using Lens and you want to add a breakdown with multiple values? A screenshot would help to understand better what you are trying to do. A runtime field that concatenates 2 fields is def an option but in newer versions of kibana you can create a breakdown with multiple values in Lens. For example:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/a/ead64217a50dab38a51976daee01cc82f294b86c.png)

---

<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, 2022, 2:27pm UTC](https://discuss.elastic.co/t/visualize-data-by-two-fields/316819/3 "2022-11-13T14:27:59Z")

</div>



---

<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:** [December 11, 2022, 6:09am UTC](https://discuss.elastic.co/t/visualize-data-by-two-fields/316819/4 "2022-12-11T06:09:09Z")

</div>



---

<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:** [January 8, 2023, 2:40am UTC](https://discuss.elastic.co/t/visualize-data-by-two-fields/316819/5 "2023-01-08T02:40:18Z")

</div>



---

<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:** [February 5, 2023, 2:40am UTC](https://discuss.elastic.co/t/visualize-data-by-two-fields/316819/6 "2023-02-05T02:40:22Z")

</div>

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