# Table displaying sum of latest values

**URL:** https://discuss.elastic.co/t/table-displaying-sum-of-latest-values/321109
**Category:** Kibana
**Tags:** vega
**Created:** [December 13, 2022, 10:51am UTC](https://discuss.elastic.co/t/table-displaying-sum-of-latest-values/321109 "2022-12-13T10:51:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tinrik](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tinrik](https://discuss.elastic.co/u/tinrik)
#### Post date: [December 13, 2022, 10:51am UTC](https://discuss.elastic.co/t/table-displaying-sum-of-latest-values/321109/1 "2022-12-13T10:51:02Z")

</div>

Hi!

Given the following example dataset showing the number of warnings in C++ files for a given date, and also containing information about which `project` each C++ file belongs to:

```auto
{ "file": "a.cpp", "project": "foo", "warnings": 123, "@timestamp": "2018-12-28 00:00"}
{ "file": "a.cpp", "project": "bar", "warnings": 123, "@timestamp": "2018-12-28 00:00"}
{ "file": "b.cpp", "project": "bar", "warnings": 12, "@timestamp": "2018-12-28 00:00"}
{ "file": "c.cpp", "project": "foo", "warnings": 321, "@timestamp": "2018-12-28 00:00"}

{ "file": "a.cpp", "project": "foo", "warnings": 12, "@timestamp": "2018-12-29 00:00"}
{ "file": "a.cpp", "project": "bar", "warnings": 12, "@timestamp": "2018-12-29 00:00"}
{ "file": "b.cpp", "project": "bar", "warnings": 1, "@timestamp": "2018-12-29 00:00"}
{ "file": "c.cpp", "project": "foo", "warnings": 32, "@timestamp": "2018-12-29 00:00"}

```

I want to create a Table in Kibana that summarizes the aggregated number of warnings for each project, for the latest timestamp (to get a quick overview of the status and be able to e.g. prioritize what to work on next):

```auto
Project name | Total number of warnings on latest day
-----------------------------------------------------------------------------------------------------
foo | 12 + 32 = 44
-----------------------------------------------------------------------------------------------------
bar | 12 + 1 = 13

```

I believe my example is very similar [to this one](https://discuss.elastic.co/t/sum-of-field-of-latest-unique-values/162322), where the answer is that the visualization should be done in Vega instead. But in this case there's no support for tables in Vega, so is there really no way at all to accomplish this?

---

<div class="post-metadata">

### Author: ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)
#### Post date: [December 13, 2022, 11:15am UTC](https://discuss.elastic.co/t/table-displaying-sum-of-latest-values/321109/2 "2022-12-13T11:15:45Z")

</div>

Hi @tinrik ,

I think you can use Lens with the table visualization for that:

 ![Screenshot 2022-12-13 at 12.11.39](https://us1.discourse-cdn.com/elastic/original/3X/3/9/39ee7da3a7717383a13dce990246f036db410579.png)

Here I've configured a `Top values of project.name` and `Sum of warnings` as metric values.

If you only want to see the current data, no matter the other panels when imported in a dashboard, you could pin a fixed date range, say `Today` to that to have always the current data, no matter the date range selected for the rest of the dashboard:

 ![Screenshot 2022-12-13 at 12.14.20](https://us1.discourse-cdn.com/elastic/original/3X/9/8/9801296702103660114c2d36a9c59d753d94663e.png)

---

<div class="post-metadata">

### Author: ![tinrik](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tinrik](https://discuss.elastic.co/u/tinrik)
#### Post date: [December 13, 2022, 12:11pm UTC](https://discuss.elastic.co/t/table-displaying-sum-of-latest-values/321109/3 "2022-12-13T12:11:39Z")

</div>

That's very neat, I wasn't aware of that feature. Thanks a lot for the quick help, really appreciated! 🙂

---

<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 10, 2023, 12:12pm UTC](https://discuss.elastic.co/t/table-displaying-sum-of-latest-values/321109/4 "2023-01-10T12:12:32Z")

</div>

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