Influxql to flux query conversion

I’m trying to use some old guide from smokeping like solution based on graphana/telegraf/influxdb

But since db is now using flux query language, nothing I try to produce out of tutorial really works.

Would really appreciate if anyone can convert this to flux language:

SELECT min("minimum_response_ms") 
FROM "ping" 
WHERE ("url" = 'x.x.x.x') 
  AND $timeFilter 
GROUP BY time($__interval), "url" fill(none)

Hello @s1117,
Welcome! Sure thing :slight_smile:
Your query should look something like this:

from(bucket:"ping")
  |> range(start: $startTime, stop: $stopTime)
  |> filter(fn: (r) =>
    r._url == "x.x.x.x." and
    r._field == "minimum_response_ms"
  )
|> aggregateWindow(
    every: $timeinterval,
    fn: min
  )

I do not know if this is a general influxql to flux topic is but i have some issues with conversion to the new 2.0
I try to learn
My old query, this the power generated by my solor panels perday, in 1.8

SELECT derivative(mean("zonnepanelen-totaal"),1d) AS "DailyPower" FROM "udp"."autogen"."Solar" WHERE time >  now() - 31d   GROUP BY time(24h) tz('Europe/Amsterdam')

dailypower
The new ( note that “zonnepanelen-totaal” changed to “Watth”), below works but i do not get the Yield per day @00:00 hour. But 10000 + results and also where to put the tz(‘Europe/Amsterdam’

  from(bucket: "Test3")
  |> range(start:now() -31d)
  |> filter(fn: (r) => r["_measurement"] == "Solar")
  |> filter(fn: (r) => r["SetNo"] == "NNW1")
  |> filter(fn: (r) => r["_field"] == "Watth")
  |> group(columns: ["1d"])
  |> derivative(unit: 1d, nonNegative: false)
  |> yield(name: "derivative")

Found a part of the solution

from(bucket: "Test3")
  |> range(start: -7d)
  |> filter(fn: (r) => r._measurement == "Solar" )
  |> filter(fn: (r) => r["SetNo"] == "NNW1")
  |> filter(fn: (r) => r["_field"] == "Watth")
  |> aggregateWindow(every: 1d, fn: mean)    //mean or max ?
  |> derivative(unit: 1d, nonNegative: true, columns: ["_value"], timeColumn: "_time")
  |> drop(columns: ["_start","_stop","Energy","_measurement","host"])

The only fix now is the correct timezone, ill get results @02:00