Hello! I’m very new with Grafana (<1 month) and Flux, so I have a myriad of issues. I’m currently using InfluxDB 2.0.9, Grafana 8.3.3, and writing in Flux.
I’m probably going to butcher this explanation, but here I go:
I’ve got a _measurement object with 23 _fields, with two of them being lat/long. My query pulls in these objects and posts each individual instance of the lat/long onto a GeoMap, which shows the path of a boat. There are multiple boats with unique ID’s. Right now, the path has only one color (red), which can make understanding the boat movements confusing, since there’s no indication of which red dot was the last known location. Is there any way to set a threshold for time or the last lat/long entry based on id, so that the latest entry is a different marker color on the map?
Query:
from(bucket: “test”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “BOAT”)
|> filter(fn: (r) => r[“_field”] == “boat.latitudeDecDeg.double” or r[“_field”] == “boat.latitudeDecDeg.double”)
|> aggregateWindow(every: ${range}, fn: last, createEmpty: false)
|> pivot(rowKey:[“_time”], columnKey: [“_field”], valueColumn: “_value”)
|> group()