Downsample system metrics with "strings"

Hello,
I’m looking to create a task to downsample collected system metrics into another bucket.

Below is the original CQ code

CREATE CONTINUOUS QUERY cq_system_metrics ON system_metrics_daily BEGIN SELECT mean() AS value INTO system_metrics.two_weeks.:MEASUREMENT FROM system_metrics_daily.two_hours././ GROUP BY time(1h) END

Since upgrading to v2.0 I have not been able to downsample the data. Here is the query I’m running

from(bucket: "system_metrics/two_hours")
	|> range(start: -task.every)
	|> aggregateWindow(every: 1h, fn: mean)
	|> to(bucket: "system_metrics/two_weeks", org: "myorg", timeColumn: "_stop")

This results in an error:

input type for mean aggregate: string

I suspect some of the metrics are “string” such as “Up” etc.

How can I overcome this?

Hi t481, the way to solve this for now is to separate the numerical and string data so that you can apply the correct aggregates. Here’s an example: