Skip to content

Instantly share code, notes, and snippets.

@ereshzealous
Created March 15, 2022 07:31
Show Gist options
  • Save ereshzealous/afc06c93cd7ac064f8a12a27cd9c8ee0 to your computer and use it in GitHub Desktop.
Save ereshzealous/afc06c93cd7ac064f8a12a27cd9c8ee0 to your computer and use it in GitHub Desktop.
from(bucket: "local")
|> range(start: -37d, 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