Benvolio
Benvolio

Reputation: 1

Is there a way to assign a percentile value to a variable?

I am setting up dynamic threshold values (upper and lower bound). These values are from a SQL statement (e.g. select percentile("value",80) from apc where metrics="temperature")

Instead of: var upperbound = 16

How can we assign the upperbound variable to the output of the SQL statement?

Upvotes: 0

Views: 456

Answers (1)

Rawkode
Rawkode

Reputation: 22592

You cannot do this with InfluxQL. You have two options:

  1. Subqueries. You can use multiple subqueries in your main query to fetch the upper and lower bounds

  2. Try our new query language, Flux

https://docs.influxdata.com/flux/v0.24/

It can be enabled on InfluxDB 1.7 and 2.0-alpha

Upvotes: 1

Related Questions