Quantcast
Viewing all articles
Browse latest Browse all 200

Variable evaluation fails when expression added

  • What Grafana version and what operating system are you using?
    [v10.1.9]

  • What are you trying to achieve?
    An InfluxDB query with a math operation that involves a variable with a decimal point

  • What happened?
    the decimal point is preceded by inserted two back slashes

  • What did you expect to happen?
    not to insert the two back slahes

  • Can you copy/paste the configuration(s) that you are having problems with?

Desired InfluxDB query where $consthousesizem2 is 2744.59:
SELECT sum(“jednotky”)/$consthousesizem2 as dumm2 FROM (SELECT spread(“value”) as jednotky FROM “teplo_kWh” WHERE $timeFilter GROUP BY “unit”::tag fill(null))

Correct query variable evaluation when no expression is involved:
q:“SELECT sum("jednotky")/2744.59 as dumm2 FROM (SELECT spread("value") as jednotky FROM "teplo_kWh" WHERE time >= now() - 30d and time <= now() GROUP BY "unit"::tag fill(null))”

Failing query variable evaluation when an expression is added (variable decimal point with two back slahes):
query:“SELECT sum("jednotky")/2744\\.59 as dumm2 FROM (SELECT spread("value") as jednotky FROM "teplo_kWh" WHERE $timeFilter GROUP BY "unit"::tag fill(null))”

If this is already solved, sorry for disturbing you Image may be NSFW.
Clik here to view.
:slight_smile:

4 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 200

Trending Articles