# Boolean Operations with Dates

**URL:** https://discuss.elastic.co/t/boolean-operations-with-dates/89206
**Category:** Kibana
**Created:** [June 13, 2017, 2:17pm UTC](https://discuss.elastic.co/t/boolean-operations-with-dates/89206 "2017-06-13T14:17:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![infamous](https://avatars.discourse-cdn.com/v4/letter/i/df705f/32.png) [@infamous](https://discuss.elastic.co/u/infamous)
#### Post date: [June 13, 2017, 2:17pm UTC](https://discuss.elastic.co/t/boolean-operations-with-dates/89206/1 "2017-06-13T14:17:56Z")

</div>

Hi all,

I'm having trouble trying to implement a filter in Kibana visualization that shows unique counts of a string within certain time periods.

I want to show the unique count of a field in a date range of 0-7 days, and then the unique count of that same field for anything after 8+ days minus values that have already appeared in 0-7 days. In other words, I want to show subset A and subset B but not values that are of A and B using date as the criteria.

Using NOT on a date range does not seem to work. Seems like a simple logic problem but I am struggling. Any suggestions?

Thanks!

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [June 13, 2017, 6:39pm UTC](https://discuss.elastic.co/t/boolean-operations-with-dates/89206/2 "2017-06-13T18:39:32Z")

</div>

@infamous Elasticsearch doesn't support this type of query, and has limited [join support](https://www.elastic.co/guide/en/elasticsearch/reference/current/joining-queries.html)

You can get pretty close to what you're looking for using a bar graph with the following configuration, but it's not excluding items from the 8+ days group that have appeared in the 0-7 days group:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/5/7/57fac721688a034bf125d2f11a582189cf6b7354.png)

---

<div class="post-metadata">

### Author: ![infamous](https://avatars.discourse-cdn.com/v4/letter/i/df705f/32.png) [@infamous](https://discuss.elastic.co/u/infamous)
#### Post date: [June 13, 2017, 7:07pm UTC](https://discuss.elastic.co/t/boolean-operations-with-dates/89206/3 "2017-06-13T19:07:58Z")

</div>

Thank you so much for the reply @Brandon_Kobel. Good to know I was not missing something simple.

---

<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: [July 11, 2017, 7:08pm UTC](https://discuss.elastic.co/t/boolean-operations-with-dates/89206/4 "2017-07-11T19:08:46Z")

</div>

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