# How to visualize data with the latest date

**URL:** <https://discuss.elastic.co/t/how-to-visualize-data-with-the-latest-date/91552>\
**Category:** Kibana\
**Created:** [July 2, 2017, 10:53am UTC](https://discuss.elastic.co/t/how-to-visualize-data-with-the-latest-date/91552 "2017-07-02T10:53:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkudlinski](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@mkudlinski](https://discuss.elastic.co/u/mkudlinski)\
**Post date:** [July 2, 2017, 10:53am UTC](https://discuss.elastic.co/t/how-to-visualize-data-with-the-latest-date/91552/1 "2017-07-02T10:53:18Z")

</div>

Hi all,

How to create a visualization that takes into account only documents with the latest date? Let's say I have documents with three fields:

- Name
- Status
- Date

And now I would like to create a chart (Name vs Status,) but only for documents with the same date - the latest one.

Something similar in SQL:  
`SELECT Name, Status FROM Documents WHERE Date = (SELECT TOP(1) Date FROM Documents ORDER BY Date DESC)`

Thank you

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [July 3, 2017, 5:27pm UTC](https://discuss.elastic.co/t/how-to-visualize-data-with-the-latest-date/91552/2 "2017-07-03T17:27:02Z")

</div>

Hi there,

Unfortunately, this isn't currently possible in Visualize. You can't express that type of "WHERE" clause to limit on a subaggregation. There's something similar in our metric agg, called Top Hit, which you can use to retrieve the last timestamp for a given term, but that isn't usable as a filter.

If you'd like to this kind of functionality added to Kibana, could you file a request on GitHub? Thanks!

CJ

---

<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:** [July 31, 2017, 5:27pm UTC](https://discuss.elastic.co/t/how-to-visualize-data-with-the-latest-date/91552/3 "2017-07-31T17:27:03Z")

</div>

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