Hi,
I’m new to flux. I already figured out some (basic) things but ‘math’ with the value’s is still complex.
I am having trouble getting the ‘map’ function to work.
So I was hoping someone could help me out.
my situation:
I have now this function:
from(bucket: "HomeData")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "PowerMeter")
|> filter(fn: (r) => r["_field"] == "kWhFromGrid")
|> aggregateWindow(every: 1d, fn: last, createEmpty : false, timeSrc:"_start")
|> difference()
|> aggregateWindow(every: 1mo , fn: sum, createEmpty : false, timeSrc:"_start")
this gives me this data representation:
this is my engergy (in kWh) used in the month.
but now i want to show the cost of this so i need to multiply this number by the cost of energy.
I am not sure if i can do this after the ‘aggregateWindow’ fuction? or do i need to use a ‘map’ function after the ‘filter’ function? and if so, how do i need to to this map fuction? i tried several things allready but without luck.
(I am doing this in Grafana)
Regards,
Thomas