# Continuous query doesn't create MEASUREMENTS

**URL:** <https://community.influxdata.com/t/continuous-query-doesnt-create-measurements/2618>\
**Category:** Systems\
**Tags:** influxdb, influxql\
**Created:** [October 8, 2017, 11:22pm UTC](https://community.influxdata.com/t/continuous-query-doesnt-create-measurements/2618 "2017-10-08T23:22:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TDeoodfig](https://avatars.discourse-cdn.com/v4/letter/t/bc8723/32.png) [@TDeoodfig](https://community.influxdata.com/u/TDeoodfig)\
**Post date:** [October 8, 2017, 11:22pm UTC](https://community.influxdata.com/t/continuous-query-doesnt-create-measurements/2618/1 "2017-10-08T23:22:40Z")

</div>

I am following the [guide](https://docs.influxdata.com/influxdb/v1.3/query_language/continuous_queries/#common-issues-with-advanced-syntax) to down sample and it’s not creating the measurement for the CQ.

I made a database Test and data will be populated in measurement “infoLog”

retention policies:  
\> show retention policies on “Test”

```
name duration shardGroupDuration replicaN default
---- -------- ------------------ -------- -------
autogen 0s 168h0m0s 1 false
4_weeks 672h0m0s 24h0m0s 1 true
a_year 8736h0m0s 168h0m0s 1 false

```

my CQ:  
name: Test  
name query  
---- -----  
` cq_2m CREATE CONTINUOUS QUERY cq_2m ON Test BEGIN SELECT mean(UsedMemory) AS mean_UsedMemory INTO Test.a_year.downsampled_orders2min FROM Test."4_weeks".infoLog GROUP BY time(2m) END`

```
cq_inst CREATE CONTINUOUS QUERY cq_inst ON Test RESAMPLE EVERY 2m BEGIN SELECT mean(InstantaneousOpsPerSec) AS mean_InstantaneousOpsPerSec INTO Test.a_year.downsampled_orders2min FROM Test.infoLog."4_weeks" GROUP BY time(2m) END

```

I’m trying to make a CQ that will get the average of a field every 2 minutes. I have also tried FOR…EVERY like this [suggests](https://community.influxdata.com/t/continuous-query-problem/1342).

Not sure what I’m doing wrong.

---

<div class="post-metadata">

**Author:** ![TDeoodfig](https://avatars.discourse-cdn.com/v4/letter/t/bc8723/32.png) [@TDeoodfig](https://community.influxdata.com/u/TDeoodfig)\
**Post date:** [October 18, 2017, 7:34pm UTC](https://community.influxdata.com/t/continuous-query-doesnt-create-measurements/2618/2 "2017-10-18T19:34:57Z")

</div>

still have this issue, any help?

---

<div class="post-metadata">

**Author:** ![sergiocntr](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sergiocntr](https://community.influxdata.com/u/sergiocntr)\
**Post date:** [October 19, 2017, 8:01pm UTC](https://community.influxdata.com/t/continuous-query-doesnt-create-measurements/2618/3 "2017-10-19T20:01:56Z")

</div>

I truly suggest you to run it with a cron command like  
`*/2 * * * * curl -i -XPOST http://localhost:8086/query --data-urlencode "q=SELECT mean(UsedMemory) AS mean_UsedMemory INTO Test.a_year.downsampled_orders2min FROM Test."4_weeks".infoLog GROUP BY time(2m)"`

In your CQ try to add `RESAMPLE EVERY 10m` :  
`CREATE CONTINUOUS QUERY cq_2m ON Test RESAMPLE EVERY 10m BEGIN SELECT mean(Used....`

if this works,delete the cron job.

Take care at this double quotes : `...FROM Test. **"** 4_weeks **"**.infoLog....`
