Calculate ratio between tags

I now understand that my query is little bit more complicated.
I want to select data from a measurement then compare it with same measurement but where I have filtered out data that is between certain numbers.

data = all values
datafiltered = values between 10 and 100

SELECT "data" / "datafiltered" FROM
(

(
SELECT count("peak") AS "data"  FROM "autogen"."CPU" WHERE ("host" =~ /^$Host$/)  AND $timeFilter GROUP BY  "Host"
)
,
(
SELECT count("peak") AS "datafiltered" FROM "autogen"."CPU" WHERE ("host" =~ /^$SHost$/) AND ("peak"< 100 OR "peak">10) AND $timeFilter GROUP BY  "Host"
)

)
1 Like