# InfluxQL: Why does integral() return 0 timestamp with paparticular series

I use the INTEGRAL() function with two identical constructed series (epever & growatt) see below.

I have no clue why integral returns a timestamp with one of the series but not with the other.

Due to this I can not use the two integration results in an expression in Grafana.

So why is this ? (InfluxDB shell version: 1.8.10)

> SELECT “Epever Power” FROM “Epever” WHERE time >= now() - 1m
name: Epever
time Epever Power
---- ------------
1669665700136709000 0
1669665710929789000 0
1669665721433642000 0
1669665731928040000 0
1669665742627442000 0
1669665753302892000 0
> SELECT “Growatt3B Power” FROM “Growatt3B” WHERE time >= now() - 1m
name: Growatt3B
time Growatt3B Power
---- ---------------
1669665721433642000 0
1669665731928040000 0
1669665742627442000 0
1669665753302892000 0
1669665763835508000 0
1669665774420154000 0
> SELECT integral(“Epever Power”,1h) FROM “Epever” WHERE time >= now() - 1m
name: Epever
time integral
---- --------
0 0
> SELECT integral(“Growatt3B Power”,1h) FROM “Growatt3B” WHERE time >= now() - 1m
name: Growatt3B
time integral
---- --------
1669665749550034931 0
^-- So why is this timestamp missing above with “Epever” ??

While the reason for having a timestamp in one case but not in the other is still unclear, I found a workaround to be able to sum this results up in a Grafana Expression.

I had to make this queries sub-queries and do a sum() on the results. this way all the timestamps become 0 and the rtesults can be combined (e.g. summed up).

SELECT sum(integral) FROM (SELECT integral(“Growatt3B Power”) FROM “Growatt3B” WHERE time >= now() - 1m)

the timestamp depends on the data gathering, are the data collected exactly at the same time? is there any guarantee that the timestamp will match? it simply does not depend on InfluxDB.

If you want the timestamps to match the best method is to `GROUP BY time(_unit_)`, this will force your data into ranges with “forced” timestamps (beginning of time interval).
If you need one value (ie: KPI) you can use an aggregation function without any time grouping, the result will have 0 as timestamp

Thanks, I’ll keep that in mind.

Still:

If you need one value (ie: KPI) you can use an aggregation function without any time grouping, the result will have 0 as timestamp

I thought that would be the case with INTEGRATE(). Isn’t it an aggregation function ? It resulted in a 0 timestamp in one case but not in the other. Still not clear why.