Expression does not deliver result

I’m using two selects:

Select 1: SELECT spread(“Total_in”) *1000 FROM “power” WHERE $timeFilter
Select 2: SELECT integral(“value”,1h) * 1000 FROM “inverter_pv_power_inverter” WHERE $timeFilter GROUP BY time(1d) fill(null)

Select 1 is delivering the “this day so far” power consumption.
Select 2 id calculating the solar generation for today. These values are stored as absolute values in the influxdb, so I need to calculate the daily solar generation with the integral function.

I would like to calculate the percentage of my own daily solar consumption from these both values, so added an expression:
($A / $B) *100
But for whatever reason dividing (or using any other mathematic function) these values does not lead to result.
I assume, that these results from the select statements are not “compatible”, but to be honest I have no idea why.
Has someone a hint to me?


Thanks a lot for that hint and link. I never stumbled across your post while searching for possible solutions.

In fact this hint “I would say the easier option can be to generate timeseries with the same timestamp, so expression will be working fine (e.g. timegrouping with long time period).” pushed me to the correct solution - using the same group statement.


1 Like