The typical CQ I’m familiar with looks like this:
SELECT mean(“value”) AS value
group by time(1m), topic
I’d like to ask how to do two things:
What are all the options for math downsampling? Can I use mean, max, min, and what else? Can I specify if the value is different from previous value by X amount? So for temperature, I don’t want average, I want to capture if the values are changed from the previous value by a certain amount.
What if I don’t want all topics within that measurement, only specific topics?
I think if you’re looking to perform more sophisticated downsampling tasks, I might recommend that you use Flux and 2.x instead.
- With 1.x and CQ you’re limited to:
InfluxQL functions | InfluxDB OSS 1.8 Documentation
But with Flux you can use so many more:
Flux standard library | Flux 0.x Documentation
You can do things like:
- manipulate timestamps
- math across measurements
- work with geotemporal data
- push and pull data form other data sources
- and more.
- What do you mean by topics? Do you mean tags? If so you can use the Where by. clause with influxql if you still want to perform CQs.
Please let me know if this helps or if I can supply any additional information.