# GROUP BY time wont work - is it issue with timestamps value in db or in the reading it? (im not sure)

**URL:** <https://community.influxdata.com/t/group-by-time-wont-work-is-it-issue-with-timestamps-value-in-db-or-in-the-reading-it-im-not-sure/16378>\
**Category:** Systems\
**Created:** [October 18, 2020, 3:02pm UTC](https://community.influxdata.com/t/group-by-time-wont-work-is-it-issue-with-timestamps-value-in-db-or-in-the-reading-it-im-not-sure/16378 "2020-10-18T15:02:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sar55](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sar55/32/5766_2.png) [@sar55](https://community.influxdata.com/u/sar55)\
**Post date:** [October 18, 2020, 3:02pm UTC](https://community.influxdata.com/t/group-by-time-wont-work-is-it-issue-with-timestamps-value-in-db-or-in-the-reading-it-im-not-sure/16378/1 "2020-10-18T15:02:52Z")

</div>

got headache, it seems to be right but clearly it isnt…why?

**SELECT value FROM n\_franluft limit 10;** gives me this…3sec interval storage…  
 ![](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/7/746e240d2fe13ff5fe02ffa6e6361d35bfece513.png)  
**SELECT “value” FROM “autogen”.“n\_tilluft” WHERE $timeFilter** gives me readings fine…

**SELECT “value” FROM “autogen”.“n\_tilluft” WHERE time \>= now() - 1h GROUP BY time(10s)** gives me error  
“InfluxDB Error: GROUP BY requires at least one aggregate function”

**"SELECT mean(“value”) FROM “n\_tilluft” WHERE time \>= now() - 3h GROUP BY time(5m) fill(null)"** gives me  
“InfluxDB Error: unsupported mean iterator type: \*query.stringInterruptIterator”

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [October 22, 2020, 9:24pm UTC](https://community.influxdata.com/t/group-by-time-wont-work-is-it-issue-with-timestamps-value-in-db-or-in-the-reading-it-im-not-sure/16378/2 "2020-10-22T21:24:31Z")

</div>

Hello @sar55,  
Hmm I’m not sure. That last query looks right.  
Can you verify that:  
Your value field type is int or float? and not a string?  
Can you verify that you have data within the last 3 hours?  
Can you calculate the mean without the group by?  
Thank you

---

<div class="post-metadata">

**Author:** ![sar55](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sar55/32/5766_2.png) [@sar55](https://community.influxdata.com/u/sar55)\
**Post date:** [October 25, 2020, 12:15pm UTC](https://community.influxdata.com/t/group-by-time-wont-work-is-it-issue-with-timestamps-value-in-db-or-in-the-reading-it-im-not-sure/16378/3 "2020-10-25T12:15:27Z")

</div>

> [@Anaisdg](#):
>
> Your value field type is int or float? and not a string?

ah… thanks… looks like this…  
 ![bild](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/8/89755dd62d61afe3f6d4e558d10a2e9dcfbbd870.png)

… how can i change from string to float?

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [October 27, 2020, 5:22pm UTC](https://community.influxdata.com/t/group-by-time-wont-work-is-it-issue-with-timestamps-value-in-db-or-in-the-reading-it-im-not-sure/16378/4 "2020-10-27T17:22:00Z")

</div>

Hello @sar55,  
There isn’t a way to do this with influxql see:

> <https://github.com/influxdata/influxdb/issues/2651>
>
> I'm trying to set this data
> 
> \`\`\`
> {"database":"3c330599-0b11-5ca8-0a43-00006fcddc…83","time":"2015-05-23T07:24:00Z","points":\[{"name":"access\_log","fields":{"IPADDR":"192.168.1.164","SIZE":126064,"SITE":"mail.articatech.com","FAMILYSITE":"articatech.com","RQS":1,"ZDATE":1432358640}}\]}
> \`\`\`
> 
> Receive this error
> 
> \`\`\`
> \- 500 - {"error":"field \\"SIZE\\" is type string, mapped as type string"}
> \`\`\`
> 
> When adding quotes in SIZE, it is working ( "SIZE":"126064")
> How to force influxdb to understand that SIZE field is an integer value ?

However you change them with Flux.

> **[Flux 0.x Documentation](https://docs.influxdata.com/influxdb/v2.0/reference/flux/)**
>
> Flux is a open source functional data scripting language designed for querying, analyzing, and acting on data.

Flux is available in 1.8+ (although I’d recommend upgrading to 2.0-r.c)

> **[toFloat() function | Flux 0.x Documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/tofloat/)**
>
> toFloat() converts all values in the \_value column to float types.
