# Counting returning users

**URL:** <https://discuss.elastic.co/t/counting-returning-users/206783>\
**Category:** Kibana\
**Created:** [November 6, 2019, 11:50am UTC](https://discuss.elastic.co/t/counting-returning-users/206783 "2019-11-06T11:50:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NQe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nqe/32/46950_2.png) [@NQe](https://discuss.elastic.co/u/NQe)\
**Post date:** [November 6, 2019, 11:50am UTC](https://discuss.elastic.co/t/counting-returning-users/206783/1 "2019-11-06T11:50:52Z")

</div>

I'd want to show both total count of users and number returning users (unique users with more than one logged session) on my dashboard. Unique count of users is easy to obtain using the _unique\_count_ aggregation on the logged user identifier field. However, I haven't figured out how to count users with more than one audit log entity.

Solution that I'm looking for would return number of unique returning users over time.

Things that I've already tried

- Adding _min\_doc\_count_ filter on _unique\_count_: does not work as the underlying cardinality aggregation has no support for this
- Using _terms aggregation_ together with _min\_doc\_count_. Returns me all the users having more than one logged sessions together with the number of logged sessions. Total number of rows returned by this combination would cover my information need.

Do you know if there's a way to do this in Kibana visualizations?

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [November 18, 2019, 10:00pm UTC](https://discuss.elastic.co/t/counting-returning-users/206783/2 "2019-11-18T22:00:15Z")

</div>

I can't think of any query that will allow you to do that. But feel free to ask in the Elasticsearch part of this forum as they will have more knowledge on some aggregations and metrics not used in Kibana which might help you.

---

<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:** [December 16, 2019, 10:00pm UTC](https://discuss.elastic.co/t/counting-returning-users/206783/3 "2019-12-16T22:00:37Z")

</div>

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