# Use Table visualization to display linked metrics from different documents

**URL:** https://discuss.elastic.co/t/use-table-visualization-to-display-linked-metrics-from-different-documents/165421
**Category:** Kibana
**Created:** [January 23, 2019, 1:45pm UTC](https://discuss.elastic.co/t/use-table-visualization-to-display-linked-metrics-from-different-documents/165421 "2019-01-23T13:45:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![nunodio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nunodio/32/38685_2.png) [@nunodio](https://discuss.elastic.co/u/nunodio)
#### Post date: [January 23, 2019, 1:45pm UTC](https://discuss.elastic.co/t/use-table-visualization-to-display-linked-metrics-from-different-documents/165421/1 "2019-01-23T13:45:13Z")

</div>

Hello all,

I'm trying to display metrics from different documents but I need to relate those metrics in the following way:

Let's assume I have **two types** of **documents** in the **same index** :

**Worker Document:**  
{  
workerID: 3948,  
workerName: John  
}

**Organization Document**  
{  
workerID: 3948,  
organizationName: Elastic  
}

Is it possible to connect "_organizationName_" and "_workerName_" by "_workerID_" to display the information in a table as below?

 ![table_visualization](https://us1.discourse-cdn.com/elastic/original/3X/7/c/7c10b9394013556f5fb62c0f36373112374f476d.png)

Thank you in advance.

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [January 24, 2019, 11:02pm UTC](https://discuss.elastic.co/t/use-table-visualization-to-display-linked-metrics-from-different-documents/165421/2 "2019-01-24T23:02:04Z")

</div>

Hi, Elasticsearch doesn't have a concept of joining or foreign keys, so the connection as you describe it isn't an option.

The best solution I've seen is to index the documents in a way where `workerName` and `organizationName` is in the same document, and a clever way of doing that would be to use `workerID` as the `_id` of the document in Elasticsearch. As additional information about the worker comes into the system, you will update document `_id: 3940`. Essentially, that merges new info with existing info. There may be field collisions, but it would only be a problem if the values are changing - then the integrity would be getting lost in the data.

As for avoiding those collisions, updating an Elasticsearch document can also be a partial operation, as opposed to a whole-document update. See [https://www.elastic.co/guide/en/elasticsearch/guide/current/partial-updates.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/partial-updates.html)

---

<div class="post-metadata">

### Author: ![nunodio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nunodio/32/38685_2.png) [@nunodio](https://discuss.elastic.co/u/nunodio)
#### Post date: [January 25, 2019, 2:10pm UTC](https://discuss.elastic.co/t/use-table-visualization-to-display-linked-metrics-from-different-documents/165421/3 "2019-01-25T14:10:32Z")

</div>

@tsullivan, thank you for your help.

---

<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 22, 2019, 2:10pm UTC](https://discuss.elastic.co/t/use-table-visualization-to-display-linked-metrics-from-different-documents/165421/4 "2019-02-22T14:10:32Z")

</div>

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