Skip to content

Instantly share code, notes, and snippets.

@ereshzealous
Created March 15, 2022 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ereshzealous/cb0b0513fcc16a02576d4b6c112c3189 to your computer and use it in GitHub Desktop.
Save ereshzealous/cb0b0513fcc16a02576d4b6c112c3189 to your computer and use it in GitHub Desktop.
from(bucket: "local")
|> range(start: -1d)
|> filter(fn: (r) => r["_measurement"] == "ticks")
|> filter(fn: (r) => r["_field"] == "price")
|> filter(fn: (r) => r["product"] == "AGUX/USD")
|> aggregateWindow(every: 1d, fn: max, createEmpty: false)
|> yield(name: "max")
from(bucket: "local")
|> range(start: -1d)
|> filter(fn: (r) => r["_measurement"] == "ticks")
|> filter(fn: (r) => r["_field"] == "price")
|> filter(fn: (r) => r["product"] == "AEBC/USD")
|> aggregateWindow(every: 1d, fn: min, createEmpty: false)
|> yield(name: "min")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment