# How to get a distinct count over a moving period?

**URL:** https://discuss.elastic.co/t/how-to-get-a-distinct-count-over-a-moving-period/136045
**Category:** Elasticsearch
**Created:** [June 15, 2018, 7:40am UTC](https://discuss.elastic.co/t/how-to-get-a-distinct-count-over-a-moving-period/136045 "2018-06-15T07:40:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jack.verstappen](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jack.verstappen](https://discuss.elastic.co/u/jack.verstappen)
#### Post date: [June 15, 2018, 7:40am UTC](https://discuss.elastic.co/t/how-to-get-a-distinct-count-over-a-moving-period/136045/1 "2018-06-15T07:40:48Z")

</div>

There are several examples on how to retrieve a moving average, but what about a distinct count over a moving period?

Best known example why this is useful is ... daily active users, which should give a distinct count of users over the past 24h in time granularity.

---

<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 13, 2018, 7:40am UTC](https://discuss.elastic.co/t/how-to-get-a-distinct-count-over-a-moving-period/136045/2 "2018-07-13T07:40:49Z")

</div>

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