Hi, I’m using v8.5.6 (623255cf2d)
I want to have a math expression like: $A{current_avg} * $B{voltage_avg}
I get the feeling that I just don’t understand the syntax for selecting the dimension within the data this since the transform works.
What I want have a math expression operate on multi dimensional data returned by an SQL query. As I understand it from the documentation: time series dimensions this may not be possible. Is that true? I can use this data in a transforms:
Yes I can split the query so it returns 1 dimension, e.g. current_avg, but I grafana sometimes still treats it as multi-dimensional, using a label “A current_avg” on the time series plot. So I still can’t use it in a math expression. Also transforms are a cumbersome way to aggregate data. I want to add the current_avg from 4 motors and that requires 3 binary transform operations but a math expression allows multiple binary operators in one expression: ($A + $B + $C + $D) * $ V
. Further there are no intermediate results that I have to hide with overrides.
Here is an example of query A:
SELECT
$__timeGroup(time,$__interval) AS time,
AVG(motor_current__value) AS current_avg,
MAX(motor_current__value) AS current_peaks,
SUM(motor_current__value) AS current_sum
FROM `$table`
WHERE
$__timeFilter(time)
AND rover_id = '$rover_id'
AND motor_current__labels__mcu_name = "drive_front_port"
GROUP BY time
ORDER BY time