Help using Derivative() function in Flux

Greetings. We have the following query & graph of some temperature data:

A new data point arrives every 30 seconds. I would like to create a query that measures the rate of change over 5 minutes (when increasing only, as we do not care about decreasing temperature).

A visual inspection of the graph indicates that on the steepest rises (upwards), we are seeing about 1 degree change over 5 minutes.

Here is the text of my query in the screenshot above:

from(bucket: "AMPdata")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "DoubleRotaryFurnaceZoneData")
  |> filter(fn: (r) => r["EquipNumber"] == "32")
  |> filter(fn: (r) => r["EquipZone"] == "quenchtank")
  |> filter(fn: (r) => r["MeasType"] == "actual")
  |> filter(fn: (r) => r["_field"] == "temperature")
  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
  |> yield(name: "last")

Here is what I tried:

The above output does not seem correct. I do not see the temperature rising 5 degrees (or even 3 degrees) over 5-minute intervals. I am confused as to whether the aggregateWindow function is correct in the above.

Any guidance is appreciated.

Hello @grant1,
Do you see the expected derivative values without the aggregate window?
Can you please share some of your data? Maybe try to limit it to ~100 points first?

Thanks @Anaisdg

I removed the aggregate window function in the derivative query and came up with data that appears to be correct. I am wondering if I was visually misinterpreting my originally shared graph (and in fact the rise over 5 min. was 5 degrees at certain times).

Just for my understanding, if I am collecting data points every 30 seconds, is the Derivative function looking at each sequential point and calculating the rate of change between those two points (e.g. 59.66 to 59.77, or 0.11 degrees change over 30 seconds, or 1.1 degrees over 5 minutes)?

I tried to attach my data, but I got this message:

so am sharing it via Google Drive: 2022-11-04_11_15_influxdb_data.csv - Google Drive

Hello @grant1,
Thank you for sharing. I’ll upload now.

It’s looking at points defined by the unit interval. So that can be subsequent points if you make the unit = to the interval between points.
Wait im confused does the data look right now? What do you need help with still?

I think all I need now is a reality check to inspect my function and the dataset that it is being applied to, and verifying that the rate of change over 5 minutes is indeed x.

Is there an option in Influx Data Explorer to view the derivative on a right hand axis? That may help me do a deeper visual inspection.