Mean() query issue

Hey All,

Have just started using InfluxDB for an app we’re building, I’ve got data being logged to the database periodically. When I query it (In Chronograf), it looks like this (every single value is the same):

SELECT (“value”) FROM “database”.“autogen”.“value_performance” WHERE time > now() - 1h

Time: value
10/21/18 09:26:28AM: 982343693503254300
10/21/18 09:26:38AM: 982343693503254300
10/21/18 09:26:48AM: 982343693503254300

When I then aggregate that data using mean(value), I get some strange values:
SELECT mean(“value”) FROM “database”.“autogen”.“value_performance” WHERE time > now() - 1d GROUP BY time(1h) FILL(null)

Time: value
10/20/18 03:00:00PM: 226971586971248130
10/20/18 04:00:00PM: 1807070662085442
10/20/18 05:00:00PM: 11759572777970990

Now, I’m fully aware that this is probably something I’m doing wrong, but I’d be interested in hearing if anyone has any ideas on how I can fix the issue :slight_smile:

Side note: when I aggregate using 1m interval, it returns the expected values.

I guess the way I expected it to work is that it would place all values into a “bucket”, and then calculate the mean based on the value and number of entries within that bucket…


crickets chirping
Any ideas?

The value is 982343693503254300 every sample for the entire last day?

Yes, I’ve actually created a github issue, as even just calculating mean() without any grouping results in a seemingly incorrect calculation.