Influxdb2 / FLUX / math operations

Hello all,

i migrated to InfluxDB2.1 and use now FLUX.
in the past (with old version and InfluxQL) it was possible to collect 2 DIFFERENT values of different datapoints and subtract them from each other.
How ist this possible in InfluxDB2.1 with FLUX ?

Any hint is very welcome !

Yes, it is possible. In my example below, I have two values: Actual and Setpoint. In the last 3 lines, I pivot based on the MeasType tag and then map a new value called alm, which is setpoint - actual. The last line displays that new value (alm) as a column.