Skip to content

Instantly share code, notes, and snippets.

@ereshzealous
Created March 15, 2022 07:27
Show Gist options
  • Save ereshzealous/7f6d61e38914e705ae9b1b8ae2707567 to your computer and use it in GitHub Desktop.
Save ereshzealous/7f6d61e38914e705ae9b1b8ae2707567 to your computer and use it in GitHub Desktop.
from(bucket: "local")
|> range(start: -30d, stop: now())
|> filter(fn: (r) => r["_measurement"] == "ticks")
|> filter(fn: (r) => r["_field"] == "price")
|> filter(fn: (r) => r["product"] == "AGUX/USD")
|> window(period: 1h)
|> first()
|> yield(name: "first")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment