Is there anyway to the arithmetical operation between two different query

influxdb

#1

Now i have two different,for example, A=select count(“value”) from test where “value”=1 and $timeFilter,B=select count(“value”) from test where $timeFilter .Now i want to make a+b,then i use both A+B and select count(“value”)+(select count(“value”)) from test where “value”=1.but it does not work, is there anyway to do this ?


#2

I know a way to do that but only for adding fields in the same measurement
Just query : select count(“fieldA”) + count(“fieldB”) from “measurement”


#3

i will try that first , thank you~


#4

this page about adding field from different measurement https://docs.influxdata.com/influxdb/v0.8/api/query_language/#joining-series


#5

Sorry, that was for a previous version. It’s not working anymore


#6

does that mean we can do nothing for this requirement now ?


#7

and now i want to compare these two queries, i want to select min of (A and B),how can i do that


#8

SELECT min(“A”), min(“B”) FROM "measurement "
look at this page query_language