# Show ratio of numbers with different time-interval lengths

**URL:** <https://discuss.elastic.co/t/show-ratio-of-numbers-with-different-time-interval-lengths/116054>\
**Category:** Kibana\
**Created:** [January 18, 2018, 1:00pm UTC](https://discuss.elastic.co/t/show-ratio-of-numbers-with-different-time-interval-lengths/116054 "2018-01-18T13:00:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![afters](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@afters](https://discuss.elastic.co/u/afters)\
**Post date:** [January 18, 2018, 1:00pm UTC](https://discuss.elastic.co/t/show-ratio-of-numbers-with-different-time-interval-lengths/116054/1 "2018-01-18T13:00:26Z")

</div>

EDIT: changed in title from "different time-intervals" to "different time-interval lengths"

I would like to display a time-series graph of the percentage of users to whom an event occurred.  
This means: the number of users to whom an event occurred during a time interval, divided by the number of "active users" - users who were mentioned in the logs in the 7 days prior to that interval.

The first part: .es(q='event:some\_event\_name', metrics=cardinality:user.keyword)  
The seconds part: .es(metrics=cardinality:user.keyword)

The time-intervals should obviously differ.

Is there a way to display this?

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [January 18, 2018, 8:45pm UTC](https://discuss.elastic.co/t/show-ratio-of-numbers-with-different-time-interval-lengths/116054/2 "2018-01-18T20:45:20Z")

</div>

You can use the `offset` parameter to get a different time interval:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/5/650d2421f43b70cc2785fa7e90c5415dae62c51f.png)

---

<div class="post-metadata">

**Author:** ![afters](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@afters](https://discuss.elastic.co/u/afters)\
**Post date:** [January 19, 2018, 9:25am UTC](https://discuss.elastic.co/t/show-ratio-of-numbers-with-different-time-interval-lengths/116054/3 "2018-01-19T09:25:15Z")

</div>

Thank you, but I believe offset still uses the same _length_ of interval as without an offset? As I pointed out, the interval-lengths differ: I'd like to divide a unique count from the last 5 minutes by a unique count from the last 7 days.

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [January 19, 2018, 8:00pm UTC](https://discuss.elastic.co/t/show-ratio-of-numbers-with-different-time-interval-lengths/116054/4 "2018-01-19T20:00:03Z")

</div>

Ahh, I see. I'm not sure that this is something you can accomplish currently.

---

<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:** [February 16, 2018, 8:00pm UTC](https://discuss.elastic.co/t/show-ratio-of-numbers-with-different-time-interval-lengths/116054/5 "2018-02-16T20:00:19Z")

</div>

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