Combining different sources in a query

Hi,

I am trying to combine data to give a calculated results in a graph.
I have the following code:
SELECT (4180 / 60 * (mean(“ta1”) - mean(“tr1”) ) * mean(“pfl”) ) / mean(“s02”)
AS “COPm”
FROM (
SELECT mean(“value”)
AS “ta1”
FROM “Temperature”
WHERE (“name” = ‘WP-H’mon—Ta—289fc479a2010312’) AND $timeFilter
), (
SELECT mean(“value”)
AS “tr1”
FROM “Temperature”
WHERE (“name” = ‘WP-H’mon—Tr—28d11356b5013c5e’) AND $timeFilter
), (
SELECT mean(“value”)
AS “s02”
FROM “Instant”
WHERE (“name” = ‘WP-Heishamon—s0_2’) AND $timeFilter
), (
SELECT mean(“value”)
AS “pfl”
FROM “Percentage”
WHERE (“name” = ‘WP-Heishamon—Pump_Flow’) AND timeFilter ) GROUP BY time(__interval) fill(linear)

When I change the first line to:
SELECT 4180 / 60 * (mean(“ta1”) - mean(“tr1”) )
Then it does work. But for the original code, it just gives a blank result.

Does anyone have any tips how I can get this working?
I’ve been working this for quite a while now, and am stuck (even with different suggestions I’ve found online)

  • bump *
    Does anyone have a suggestion for me?