granularity in groupBy it monthly, yearly, all-time availabale?


I am making a count, cardinality or hyperlog uniques (I am not sure what is the difference between the last 2),

And I noticed that granularity is mandatory for groupBy queries, and we can go minute, hour or day, not higher.

However business needs many metrics at month level or even yearly or all-time.

How can these be achieved?

Thank you,



You can use duration or period granularity . pls see

– Himanshu

Yes, you can use any granularity that can be expressed as an ISO period

For instance P1M would be one month, P1Y would be yearly.

There is also granularity “all” for all time.

Regarding hyperloglog vs cardinality, they share similarities, the difference is mainly at the storage level.

cardinality allows you to count unique values of any string dimension.

hyperunique is meant to count uniques of a dimensions already encoded as a hyperunique sketch at ingestion time, i.e. it does not store the values anymore, but only stores the unique count of values that were ingested, does that make sense?