I am using influxQL to query data from influxdb in order to see visualisations on Grafana. There are columns in the table , those are basically fields and tags, I want to count the distinct values of a tag column by grouping it by hourly time frame. this is my query
SELECT COUNT(DISTINCT("tag")) FROM "measurement" GROUP BY time(1h)
I am not getting output after running this total unique tags = 10
Time tag
1:00:00 1
1:10:10 4
1:30:10 3
1:45:00 1
2:00:00 3
2:50:00 3
3:00:00 10
3:13:00 5
What I am expecting -
Time tag
1st hour 3 ( because 1,4,3 are 3 unique ids in that hour frame)
2nd hour 1
3rd hour 2