# Unique count of users and if the user appear in the following months do not count it at all

**URL:** <https://discuss.elastic.co/t/unique-count-of-users-and-if-the-user-appear-in-the-following-months-do-not-count-it-at-all/106414>\
**Category:** Kibana\
**Created:** [November 5, 2017, 10:18am UTC](https://discuss.elastic.co/t/unique-count-of-users-and-if-the-user-appear-in-the-following-months-do-not-count-it-at-all/106414 "2017-11-05T10:18:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MariusCojocaru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mariuscojocaru/32/23819_2.png) [@MariusCojocaru](https://discuss.elastic.co/u/MariusCojocaru)\
**Post date:** [November 5, 2017, 10:18am UTC](https://discuss.elastic.co/t/unique-count-of-users-and-if-the-user-appear-in-the-following-months-do-not-count-it-at-all/106414/1 "2017-11-05T10:18:32Z")

</div>

Hi everyone,

I want to create a chart using timelion to show me the unique users since the begining for a month.  
I want to count the user only in the first month of usage and if it appears in the following months to not count it at all.  
For the moment I managed to get the uniques in a month using: .es(metric='cardinality:username.keyword').

---

<div class="post-metadata">

**Author:** ![MariusCojocaru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mariuscojocaru/32/23819_2.png) [@MariusCojocaru](https://discuss.elastic.co/u/MariusCojocaru)\
**Post date:** [November 6, 2017, 3:35am UTC](https://discuss.elastic.co/t/unique-count-of-users-and-if-the-user-appear-in-the-following-months-do-not-count-it-at-all/106414/2 "2017-11-06T03:35:23Z")

</div>

Did anyone had this issue before?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 6, 2017, 7:02am UTC](https://discuss.elastic.co/t/unique-count-of-users-and-if-the-user-appear-in-the-following-months-do-not-count-it-at-all/106414/3 "2017-11-06T07:02:22Z")

</div>

Looks like you're needing to consolidate information around a user and/or session entity in order to do this type of analysis. [Entity-centric indexing](https://www.youtube.com/watch?v=yBf7oeJKH2Y3) is a common pattern that may help you achieve this.

---

<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 4, 2017, 7:02am UTC](https://discuss.elastic.co/t/unique-count-of-users-and-if-the-user-appear-in-the-following-months-do-not-count-it-at-all/106414/4 "2017-12-04T07:02:27Z")

</div>

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