Hey there!
I have a small issue with a query and hoping for your help. I rebuild my original problem with Grafana’s InfluxDb test dashboard.
I’m trying to select the synchronized maximum of the sum of the values where “datacenter” is “Asia” and “Europe”. Therefore i’m using the following statement:
Query 1:
SELECT max("value_sum")
FROM(
SELECT "value_E", "value_A", "value_E"+"value_A" AS "value_sum"
FROM
(SELECT "value" AS "value_E"
FROM "logins.count"
WHERE "datacenter" = 'Europe'),
(SELECT "value" AS "value_A"
FROM "logins.count"
WHERE "datacenter" = 'Asia')
FILL(previous)
)
The “FILL(previous)” statement is used by me to fill the time gaps. I compared the result with the subselect’s result (Query 2) and found out that the maximum of query 1 is not the maximum of “value_sum” of the query 2. So in my opinion im getting a false result, but why? And how do i get the real maximum?
Query 2:
SELECT "value_E", "value_A", "value_E"+"value_A" AS "value_sum"
FROM
(SELECT "value" AS "value_E"
FROM "logins.count"*
WHERE "datacenter" = 'Europe'),
(SELECT "value" AS "value_A"
FROM "logins.count"*
WHERE "datacenter" = 'Asia')
FILL(previous)
Additional: I tried the query in Chronograph (to ensure the problem doesn’t get caused by Grafana) and got the exact same result.
Thank you really much!