I have a measurement in which I sum a field and group it by tag. Then from that, I want to fetch top 10 tagged fields. Basically, I want to get top 10 sum(field) grouped by tag. In influx DB: 1.4, I do it through a top function on the subquery and tag.
Example: To see top 10 city visits in the last 7 days.
select top(“num_items”,“cityCode”,10) from(SELECT sum(“visits”) as num_items FROM “events” WHERE (“country” = ‘USA’) AND time >= now() - 7d and time <= now() GROUP BY “cityCode”)
However, the same query does not work in Influx 1.2.2. Was there an issue in this version or it was a new feature. Or is there a different query in version 1.2.2