Active users last n days


I’m very new to Druid, so my apologies if this question has already been answered, but I’ve searched quite extensively.

The problem I’m trying to solve is pretty well explained in sql in this article:

but to sum it up, I want a time series, which per day, shows the (distinct) active users for the last n days, where could be 7.

One can assume that I have data describing if a user was active on any given day.

So my question is how do I go about writing this query, if it’s even possible in Druid.


Hi Erik, you’ll need a hyperUnique metric for your active users on the ingestion side. On the query side, you can write a query with the interval for the last 7 days and a query aggregator for the hyperUnique metric.