Manipulate dual axis graphs independently in InfluxDB 2.0 using its new Flux language

Manipulate dual axis graphs independently

I have a dual axis graphs setup.

One graph is GPU power usage (values are from sensors's power1 value in Linux), other graph is average CPU frequency (values are from /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq). I’m trying to multiply the CPU frequency graph by 1000 to get the GHz, and convert the GPU power to percentage (100.0 / 135.0 * r._value).

Flux code

from(bucket:“sensors”)
|> range(start:v.timeRangeStart,stop:v.timeRangeStop)
|> filter(fn:(r) =>
r._measurement == “sensors” and
r._field == “GPUpower” or r._field == “CPUfreq”
)

When I add

|> map(fn: (r) => ({ r with _value: 100.0 / 135.0 * r._value }))

obviously both graphs are manipulated, but I can’t figure out how to manipulate them independently. It was easy to do in InfluxDB 1.x, but I can’t figure it out in InfluxDB 2.0 with its new Flux language.