influxdata / influxdata/docs-v2
Common variable queries should include a method for showing all values
- Dominant language
- JavaScript
- Stars
- 82
- Forks
- 326
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 82
Description
Here's a message from community slack: https://influxcommunity.slack.com/archives/CH8RV8PK5/p1631632955155400
The pattern is essentially:
Add a custom row to your variable with a value of your choosing to represent all values (`*`)
```
import "influxdata/influxdb/schema"
import "array"
variable_query = schema.measurements(bucket: "telegraf")
all_values = array.from(rows: [{_value: "*"}])
union(tables: [variable_query, all_values])
```
then in my query, i do something in the filter like:
```
|> filter(fn: (r) => if v.my_variable == "*" then true else r.tag == v.my_variable)
```
##### Relevant URLs
- https://docs.influxdata.com/influxdb/cloud/visualize-data/variables/common-variables/
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.