On some timeseries panels, I add horizontal lines whose Y value is a variable. The trick is essentially to multiply a timeseries which I know will always have data points by 0, then add the variable as a constant.
The image below was created using this method, so I’m positive that it works.
The query looks essentially like:
SELECT "timeseries_that_has_values" * 0 + $Variable
FROM "data_source"
WHERE ("foo" = 'bar')
AND $timeFilter
If I replace $Variable by, say, 1, I get this:
Again, it works.
If I check the variable value, there it is:
But if I use it in the query, I get an error:
“error parsing query: found FROM, expected identifier, string, number, bool at line 1, char 43”
Upon investigation, this is the query sent, which understandably yields the error above:
If you look closely, the variable value is simply not inserted in the query after the “+”
Any thoughts on what could be going on?