Calculating MAX(COUNT(some_dimnsion)) in druid

I want to calculate which value in a dimension field is occurring the most in my data-source. It will be like MAX(COUNT(some_dimension)).
The groupBy query will give me COUNT(some_dimension) but how do I get MAX of it?
How the query should be like?

I’m not sure exactly what you mean by this, but, perhaps a topN query or a groupBy with limitSpec is what you’re looking for.

Yeah. That’s right. But I’m using caravel as visualization tool for druid and it does not have support for topN query. So i’m looking for a groupBy query for the same result. But druid don’t have MAX as post aggregation. So what can I do?


Would doing a limitSpec on the count column, descending order, with limit = 1 work? That means about the same thing as a topN, except it’s exact instead of approximate.