# Downsample system metrics with "strings"

**URL:** <https://community.influxdata.com/t/downsample-system-metrics-with-strings/20560>\
**Category:** Checks & Notifications\
**Tags:** influxdb, query, flux, tasks, downsample\
**Created:** [June 29, 2021, 5:38pm UTC](https://community.influxdata.com/t/downsample-system-metrics-with-strings/20560 "2021-06-29T17:38:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![t481](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/t481/32/6012_2.png) [@t481](https://community.influxdata.com/u/t481)\
**Post date:** [June 29, 2021, 5:38pm UTC](https://community.influxdata.com/t/downsample-system-metrics-with-strings/20560/1 "2021-06-29T17:38:17Z")

</div>

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![russ\_savage](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/russ_savage/32/580_2.png) [@russ\_savage](https://community.influxdata.com/u/russ_savage)\
**Post date:** [June 29, 2021, 7:47pm UTC](https://community.influxdata.com/t/downsample-system-metrics-with-strings/20560/2 "2021-06-29T19:47:05Z")

</div>

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:

> <https://github.com/influxdata/community-templates/blob/master/downsampling/default_inputs/downsampling_tasks.yml#L16>
