Basically we’re integrating InfluxDB and Grafana in our work. We’re using InfluxDB as database source, and producing visualizations in Grafana. Is it possible to query the product of Voltage and Current directly in Grafana dashboard? How do we get to the energy from power in Grafana dashboard? Any help is highly appreciated.
collectionInterval = 5m
from(bucket: “Grafana_Bucket”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r._measurement == “19042023_V24_City_1R_ECO_sathish_battery_switch_test_new” and
(r._field == “BF_CellVoltage1” or r._field == “BMSF_ChargingCurrent”)
)
|> map(fn: (r) => ({ r with power: r.BF_CellVoltage1 * r.BMSF_ChargingCurrent }))
|> integral(unit: collectionInterval, column: “power”)
|> rename(columns: { power: “energy” })
|> aggregateWindow(every: 1d, fn: sum, column: “energy”)
.Please help me to find solution
i am trying to execute this query in grafana but even getting error like Power Does Not exist