# Visualisation based on filter

**URL:** <https://discuss.elastic.co/t/visualisation-based-on-filter/166135>\
**Category:** Elasticsearch\
**Created:** [January 29, 2019, 10:04am UTC](https://discuss.elastic.co/t/visualisation-based-on-filter/166135 "2019-01-29T10:04:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![javidr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javidr/32/136982_2.png) [@javidr](https://discuss.elastic.co/u/javidr)\
**Post date:** [January 29, 2019, 10:04am UTC](https://discuss.elastic.co/t/visualisation-based-on-filter/166135/1 "2019-01-29T10:04:54Z")

</div>

Hi

I have a question regarding visualisations when selecting the maximum value from a field. Let me explain

I have an index where i have a document with the structure {timestamp, data}, so it can be like

{timestamp: 2019-01-27, car: ferrari}  
{timestamp: 2019-01-27, car: ferrari}  
{timestamp: 2019-01-27, car: ford}  
{timestamp: 2019-01-26, car: ferrari}  
{timestamp: 2019-01-26, car: ferrari}  
{timestamp: 2019-01-26, car: ferrari}

What i want to visualise is the number of cars in a table for the maximum timestamps, so it should visualise

Ferrari 2  
Ford 1

If i create as metric max timestamp, it displays the value of the maximum timestamp correctly, but then, i am not able to do a count of cars on that bucket

Any idea on how can i do this?

Thanks

---

<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 26, 2019, 10:04am UTC](https://discuss.elastic.co/t/visualisation-based-on-filter/166135/2 "2019-02-26T10:04:55Z")

</div>

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