# How do I aggregate/rollup/transform an index that will allow me to see # of daily active users?

**URL:** https://discuss.elastic.co/t/how-do-i-aggregate-rollup-transform-an-index-that-will-allow-me-to-see-of-daily-active-users/333873
**Category:** Kibana
**Created:** [May 19, 2023, 2:16pm UTC](https://discuss.elastic.co/t/how-do-i-aggregate-rollup-transform-an-index-that-will-allow-me-to-see-of-daily-active-users/333873 "2023-05-19T14:16:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pocketcolin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pocketcolin/32/117585_2.png) [@pocketcolin](https://discuss.elastic.co/u/pocketcolin)
#### Post date: [May 19, 2023, 2:16pm UTC](https://discuss.elastic.co/t/how-do-i-aggregate-rollup-transform-an-index-that-will-allow-me-to-see-of-daily-active-users/333873/1 "2023-05-19T14:16:06Z")

</div>

My eventual goal is to graph number of daily active users in Kibana. However, to get there, I think I need an index that aggregates user activity per day. To give a little context - every user activity is logged as a single record (with a userId value) in an index. An aggregate index would need to group those records per day unique'd by userId. Let me know if I need to clarify anything here!

Host: Elastic Cloud  
Elastic Version: 8.7

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 19, 2023, 11:25pm UTC](https://discuss.elastic.co/t/how-do-i-aggregate-rollup-transform-an-index-that-will-allow-me-to-see-of-daily-active-users/333873/2 "2023-05-19T23:25:46Z")

</div>

HI @pocketcolin

If you just want a Graph Kibana Lens should be able to right out of the box  
x-axis Date Histogram Min Bucket 1 day,  
Y Axis Unique Count user\_id  
Here is one I just built from the eCommerce Sample Data Set  
I put on total count as well just so you could see

 ![Screenshot 2023-05-19 at 4.22.54 PM](https://us1.discourse-cdn.com/elastic/original/3X/6/9/69bae1c8de77ad4105b06d680dd27e4cf588bd2f.jpeg)

 ![Screenshot 2023-05-19 at 4.25.27 PM](https://us1.discourse-cdn.com/elastic/original/3X/6/4/64af9ca3855f3c046b5277d6b98135ac5b626395.png)

If you want to actually persist the data perhaps you should take a look at transforms, which are pretty much tailor-made for what you want to do

> **[Transforming data | Elasticsearch Guide \[8.7\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/transforms.html)**

Pivot Transform

 ![Screenshot 2023-05-19 at 4.24.46 PM](https://us1.discourse-cdn.com/elastic/original/3X/0/3/0341731d13d57dba95deff27992fe70295827d2e.png)

---

<div class="post-metadata">

### Author: ![pocketcolin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pocketcolin/32/117585_2.png) [@pocketcolin](https://discuss.elastic.co/u/pocketcolin)
#### Post date: [May 22, 2023, 1:31pm UTC](https://discuss.elastic.co/t/how-do-i-aggregate-rollup-transform-an-index-that-will-allow-me-to-see-of-daily-active-users/333873/3 "2023-05-22T13:31:36Z")

</div>

Oh that's perfect! Thanks, Stephen!

---

<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: [June 19, 2023, 1:32pm UTC](https://discuss.elastic.co/t/how-do-i-aggregate-rollup-transform-an-index-that-will-allow-me-to-see-of-daily-active-users/333873/4 "2023-06-19T13:32:05Z")

</div>

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