# Active Guests Count

**URL:** <https://discuss.elastic.co/t/active-guests-count/225549>\
**Category:** Kibana\
**Created:** [March 29, 2020, 12:09pm UTC](https://discuss.elastic.co/t/active-guests-count/225549 "2020-03-29T12:09:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![deutschermann](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@deutschermann](https://discuss.elastic.co/u/deutschermann)\
**Post date:** [March 29, 2020, 12:09pm UTC](https://discuss.elastic.co/t/active-guests-count/225549/1 "2020-03-29T12:09:56Z")

</div>

I want to know the count and details of active guests in hotel.  
I have check-in time and check-out time. Check-out time is null, if guest is still in the hotel.  
I have another column, which says "Status", like, 'checked-in' for guests in hotel, and 'checked-out' for guests that leave. I want to show how many guests were active in hotel at any specific time, also, the details of active guests (like, name, address, phone, etc) in Kibana.  
Any suggestions?

---

<div class="post-metadata">

**Author:** ![poff](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/poff/32/81795_2.png) [@poff](https://discuss.elastic.co/u/poff)\
**Post date:** [April 1, 2020, 5:13pm UTC](https://discuss.elastic.co/t/active-guests-count/225549/2 "2020-04-01T17:13:21Z")

</div>

Hey there!

If I'm understanding correctly, I'm thinking you could accomplish this with a metric visualization (to show count of all active guests) and a data table visualization to show the details of all active guests.

For each one, when creating the visualization, you could click the "Add filter" button and then choose the check-out time field and set to "does not exist".

This should filter your dataset to only show "active guests" in your visualizations

---

<div class="post-metadata">

**Author:** ![deutschermann](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@deutschermann](https://discuss.elastic.co/u/deutschermann)\
**Post date:** [April 3, 2020, 6:50pm UTC](https://discuss.elastic.co/t/active-guests-count/225549/3 "2020-04-03T18:50:37Z")

</div>

Thanks Poff!  
This makes sense. Although, there's a challenge to this.  
We upload data to Elasticsearch on a daily basis. And, we append the data.  
So, for example, we have a guest checked-in today. The Status will say "Checked-in". We upload the data into ES, and that's it.  
Tomorrow, this guest checks-out. So, we add another row to the existing index with all the columns containing same information, except, 'Status' now says 'Checked-out' and Non-Null value in "Check-out date" column. Note that the first row, with "Status" as 'Checked-in' remains intact. For this one guest, we have 2 rows of data in ES, one without check-out information, and one with check-out info.

Now, we can't use the logic suggested by you, because that would show me all the checked-in guests as "active guests", irrespective of how many of them checked-out, or how many are still checked-in.

Any suggestions to get this done?

---

<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:** [May 1, 2020, 6:50pm UTC](https://discuss.elastic.co/t/active-guests-count/225549/4 "2020-05-01T18:50:39Z")

</div>

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