# Create a table showing two "sibling" elements

**URL:** https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112
**Category:** Kibana
**Created:** [July 7, 2021, 9:04pm UTC](https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112 "2021-07-07T21:04:41Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![rgahan5c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rgahan5c/32/91308_2.png) [@rgahan5c](https://discuss.elastic.co/u/rgahan5c)
#### Post date: [July 7, 2021, 9:04pm UTC](https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112/1 "2021-07-07T21:04:41Z")

</div>

I have data that is in the form:

```auto
{
  user_email: "test@example.com",
  number_of_emails_sent: 100,
  ...
}

```

I would like to display it in a table like:

| User Email | Number of Emails Sent |
| --- | --- |
| test@example.com | 100 |

I have tried to do it via Data Table visualization, as well as in TSVB, to no avail. Is this possible?

As a bonus question, I will get one document for each user every day. Is there a way to make the visualization only utilize the most recent document associated with the user? Or would you handle that via time filters?

---

<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: [July 7, 2021, 10:01pm UTC](https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112/2 "2021-07-07T22:01:29Z")

</div>

Hi,

You should take a look at lens and its definitely possible [Kibana Lens | Elastic](https://www.elastic.co/kibana/kibana-lens)

 ![Screen Shot 2021-07-07 at 5.58.42 PM](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d58b4dc73ce8660d6fa97fc85cd1348afa4f70de.jpeg)

I would say handling the most recent document via timepicker is the easiest way to go. You can also save the search or the dashboard with timepicker for the last time period in which case every time you open it - you will open it for your needed time period.

Thanks  
Bhavya

---

<div class="post-metadata">

### Author: ![rgahan5c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rgahan5c/32/91308_2.png) [@rgahan5c](https://discuss.elastic.co/u/rgahan5c)
#### Post date: [July 8, 2021, 1:32pm UTC](https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112/3 "2021-07-08T13:32:03Z")

</div>

When I use Lens, I can make a table laid out like:

| Top values of user\_email.keyword | Top values of number\_of\_emails\_sent.keyword | Count of records |
| --- | --- | --- |

When what I'm looking for is:

| User Email | Number of Emails Sent |
| --- | --- |
| test@example.com | 100 |
| And so on each user |

Is that possible, either in Lens or another tool?

---

<div class="post-metadata">

### Author: ![ghudgins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghudgins/32/138532_2.png) [@ghudgins](https://discuss.elastic.co/u/ghudgins)
#### Post date: [July 8, 2021, 1:46pm UTC](https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112/4 "2021-07-08T13:46:01Z")

</div>

Try using the "Last value" for your number of emails sent instead of a count of records as the metric.

---

<div class="post-metadata">

### Author: ![rgahan5c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rgahan5c/32/91308_2.png) [@rgahan5c](https://discuss.elastic.co/u/rgahan5c)
#### Post date: [July 8, 2021, 1:48pm UTC](https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112/5 "2021-07-08T13:48:35Z")

</div>

Where might I find that option in Lens? I don't see it when I click on the number of emails sent column in the section on the right of the screen

UPDATE:  
I changed the grouping to both overall top and then top value for each, and neither of them gave what I was looking for. Additionally, when I removed the "count of records" column, the table doesn't display any data.

---

<div class="post-metadata">

### Author: ![ghudgins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghudgins/32/138532_2.png) [@ghudgins](https://discuss.elastic.co/u/ghudgins)
#### Post date: [July 8, 2021, 2:34pm UTC](https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112/6 "2021-07-08T14:34:15Z")

</div>

try moving "number of emails sent" to "metric" instead of column

---

<div class="post-metadata">

### Author: ![rgahan5c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rgahan5c/32/91308_2.png) [@rgahan5c](https://discuss.elastic.co/u/rgahan5c)
#### Post date: [July 8, 2021, 3:06pm UTC](https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112/7 "2021-07-08T15:06:07Z")

</div>

I am running Kibana 7.7.1, is this feature available for that version? I don't see that option when looking at the Lens page.

---

<div class="post-metadata">

### Author: ![ghudgins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghudgins/32/138532_2.png) [@ghudgins](https://discuss.elastic.co/u/ghudgins)
#### Post date: [July 8, 2021, 3:33pm UTC](https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112/8 "2021-07-08T15:33:34Z")

</div>

ah, yeah. it's not available in Lens in 7.7 and unfortunately "Top Hits" isn't available in non-Lens data tables either in your version.

you could do a non-Lens vertical / horizontal bar chart set up to "Top Hits" (same aggregation Lens' "Last Value" uses)

---

<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: [August 5, 2021, 3:33pm UTC](https://discuss.elastic.co/t/create-a-table-showing-two-sibling-elements/278112/9 "2021-08-05T15:33:47Z")

</div>

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