# Kibana 5 coordinate map - unique terms

**URL:** <https://discuss.elastic.co/t/kibana-5-coordinate-map-unique-terms/104507>\
**Category:** Kibana\
**Created:** [October 19, 2017, 7:32am UTC](https://discuss.elastic.co/t/kibana-5-coordinate-map-unique-terms/104507 "2017-10-19T07:32:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tallavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tallavi/32/73613_2.png) [@tallavi](https://discuss.elastic.co/u/tallavi)\
**Post date:** [October 19, 2017, 7:32am UTC](https://discuss.elastic.co/t/kibana-5-coordinate-map-unique-terms/104507/1 "2017-10-19T07:32:02Z")

</div>

Hi,

I'm trying to do a visualization, of what I percieve to be quite a basic scenario, but I can't get it to work!

Each document have: clientId (string), timestamp, geohash.

I want to show a map of the LATEST location for each clientId, meaning:

Group by unique ClientId, get the max timestamp for each, show only these documents on the map.

Unfortunately, it looks like the coordinate map visualization is missing sub aggregations, so I'm not able to shape my data and aggregate it before showing it, like I can in other visualizations! Or can I?

Thanks in advance,

Tal

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [October 24, 2017, 7:57am UTC](https://discuss.elastic.co/t/kibana-5-coordinate-map-unique-terms/104507/2 "2017-10-24T07:57:45Z")

</div>

Hi,

sorry for the late reply.

Unfortunately you currently are not able to do this. What you are asking would require the possibility to show single documents on the map. We currently only have the possibility to show values aggregated by their location. Though we have currently efforts in improving our mapping capabilities and we hopefully can provide you with a solution to that problem in upcoming versions.

Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![tallavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tallavi/32/73613_2.png) [@tallavi](https://discuss.elastic.co/u/tallavi)\
**Post date:** [October 24, 2017, 9:37am UTC](https://discuss.elastic.co/t/kibana-5-coordinate-map-unique-terms/104507/3 "2017-10-24T09:37:08Z")

</div>

Hi @timroes ,

Thanks for the reply!

Is it possible somehow to run an elastic query to aggregate the results (something like a materialized view), and use THAT as a data source for the map visualization? Or any other workaround you can think of?

Thanks!

Tal

UPDATE: I read your answer again and I would like to rephrase the question: I understand that the map visualization shows documents aggregated by the location, so I will see multiple documents that are at the same location as 1 point. That's fine. But I would like to filter the documents I'm showing (unique client ids, maximum timestamp). Is it somehow possible (perhaps by using the advanced json input somehow) to specify a pre-filter for the documents that are shown and not use the raw documents (all of them) as the datasource?

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [October 24, 2017, 12:43pm UTC](https://discuss.elastic.co/t/kibana-5-coordinate-map-unique-terms/104507/4 "2017-10-24T12:43:38Z")

</div>

Hi,

I still guess it's not possible. You can filter the documents that go into aggregations, but what you basically need is joining over multiple documents (to find the once with the highest timestamp in each bucket). I am sorry, but I fear, that is even with advanced JSON input not possible to achieve something like this, since that would require multiple queries to execute in a chain (basically finding all those documents, and THEN doing the geo aggregation with only these documents). Kibana as it is currently, isn't meant to do those multiple chaining requests.

Cheers,  
Tim

---

<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:** [November 21, 2017, 12:53pm UTC](https://discuss.elastic.co/t/kibana-5-coordinate-map-unique-terms/104507/5 "2017-11-21T12:53:37Z")

</div>

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