Hi ,
My evaluation node is outputting
{"series":null}
Here is how my tick script looks like.
// Parameters
var every = 10s
// Dataframe
// check - http://192.168.12.34:9092/kapacitor/v1/tasks/test/step1
// Past one week average
var weeklyAverage = batch
|query('SELECT mean(voc)
AS average
FROM "sensordata"."autogen"."voc"
')
.period(7d)
.every(every)
.groupBy('eui')
.align()
|httpOut('step1')
// Past one week minimum
var weeklyMinimum = batch
|query('SELECT min(voc)
AS minimum
FROM "sensordata"."autogen"."voc"
')
.period(7d)
.every(every)
.groupBy('eui')
.align()
|httpOut('step2')
var data = weeklyAverage
|join(weeklyMinimum)
.as('weeklyAverage', 'weeklyMinimum')
.tolerance(2w)
|httpOut('step3')
data
|eval(lambda: float("weeklyAverage.average") - float("weeklyMinimum.minimum"))
.as('avgMinDiff')
.keep()
|httpOut('step4')
Here are the output looks like
step 1:
{“series”:[{“name”:“voc”,“tags”:{“eui”:“0015BC0036000016”},“columns”:[“time”,“average”],“values”:[["2019-01-26T16:17:20Z",80.69540229885058]]},{"name":"voc","tags":{"eui":"0015BC0036000018"},"columns":["time","average"],"values":[["2019-01-26T16:17:20Z",75.48872180451127]]},{"name":"voc","tags":{"eui":"0015BC0036000019"},"columns":["time","average"],"values":[["2019-01-26T16:17:20Z",76.21692307692308]]},{"name":"voc","tags":{"eui":"0015BC003600001B"},"columns":["time","average"],"values":[["2019-01-26T16:17:20Z",69.83559577677225]]}]}
step 2:
{"series":[{"name":"voc","tags":{"eui":"0015BC0036000016"},"columns":["time","minimum"],"values":[["2019-01-28T13:44:43.899835136Z",0]]},{"name":"voc","tags":{"eui":"0015BC0036000018"},"columns":["time","minimum"],"values":[["2019-01-28T13:42:57.079118848Z",0]]},{"name":"voc","tags":{"eui":"0015BC0036000019"},"columns":["time","minimum"],"values":[["2019-01-28T13:42:13.173929984Z",0]]},{"name":"voc","tags":{"eui":"0015BC003600001B"},"columns":["time","minimum"],"values":[["2019-01-28T13:47:57.325380096Z",0]]}]}
step 3:
{"series":[{"name":"voc","tags":{"eui":"0015BC0036000016"},"columns":["time","weeklyAverage.average","weeklyMinimum.minimum"],"values":[["2019-01-28T00:00:00Z",80.69540229885058,0]]},{"name":"voc","tags":{"eui":"0015BC0036000018"},"columns":["time","weeklyAverage.average","weeklyMinimum.minimum"],"values":[["2019-01-28T00:00:00Z",75.48872180451127,0]]},{"name":"voc","tags":{"eui":"0015BC0036000019"},"columns":["time","weeklyAverage.average","weeklyMinimum.minimum"],"values":[["2019-01-28T00:00:00Z",76.21692307692308,0]]},{"name":"voc","tags":{"eui":"0015BC003600001B"},"columns":["time","weeklyAverage.average","weeklyMinimum.minimum"],"values":[["2019-01-28T00:00:00Z",69.83559577677225,0]]}]}
step 4:
{"series":null}
One thing to be remembered is execution is happening today i.e 2019-02-02T16:40:00Z