Grouping by month and/or year

Guess grouping by month is not yet supported. When will it be added? Is the following an appropriate workaround in the mean time?

  1. Add a month tag (possible values will be either 1 to 12, 0 to 11, jan to dec, etc) and year tag.
  2. Calculate the month and year based on the timestamp using some other means.
  3. Insert record with timestamp, month, year.
  4. Query the data using GROUP BY year, month.
1 Like

I agree this is a very useful feature.

sbains, what about my workaround?

I think most of the graphing tools will take care of this problem as long as they are aware of Timeseries (DB). e.g. Grafana. So I’m sure these tools have either already solved or working on solving the underlying issue.

Adding tags is also a nice approach but you have to justify the cost of the resources (for running Influx) vs this feature/functionality. But your approach is correct and should work. Maybe introduce a single Tag which contain both Month and year. The Influxdb allow tag searches using regex so single field solution can also work.