[
{
"ID": 2794563,
"Timestamp": "2017-08-11T05:57:06.356Z",
"Parameter": "Alarmanlage_Status",
"Username": "10.0.0.21",
"Value": "0",
"P1": "Homematic",
"P2": "LAN",
"P3": "HM",
"P4": "x",
"P5": "x"
},
{
"ID": 2854028,
"Timestamp": "2017-08-19T17:19:55.776Z",
"Parameter": "Alarmanlage_Status",
"Username": "10.0.0.21",
"Value": "1",
"P1": "Homematic",
"P2": "LAN",
"P3": "HM",
"P4": "x",
"P5": "x"
},[(
$groups := payload.{
Parameter: [
$.{"x": Timestamp, "y": Value}
]
}~>$spread();
$series := $count($groups);
$series = 0 ? undefined : $groups {
"series": $keys(),
"data": $series = 1 ? [[*]] : $.[*]
}
)]Unfortunately the output of this function is "undefined".undefinedCan anybody help me to prepare this data for my chart object ?
[{"id":"703dc06e.d8032","type":"inject","z":"322ca28f.0bf11e","name":"","topic":"","payload":"5","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":235,"y":101,"wires":[["e7e359bb.f04148"]]},{"id":"e7e359bb.f04148","type":"MSSQL","z":"322ca28f.0bf11e","mssqlCN":"c0008e37.2f5d2","name":"Test_One","query":"select top 10 * from weblog","outField":"payload","x":196,"y":368,"wires":[["e07e0a69.e2cd58"]]},{"id":"fbae2502.ac9878","type":"debug","z":"322ca28f.0bf11e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":606.5,"y":353,"wires":[]},{"id":"e07e0a69.e2cd58","type":"change","z":"322ca28f.0bf11e","name":"Test01","rules":[{"t":"set","p":"payload","pt":"msg","to":"Value[].$number()","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":383,"y":364,"wires":[["fbae2502.ac9878"]]},{"id":"c0008e37.2f5d2","type":"MSSQL-CN","z":"","name":"IOT","server":"10.0.0.19","encyption":false,"database":"WeblogDB"}]
sure:I hope thats what you expect :)
Ok, I think i reached the next level now :)
...
msg : string[15]"Bad data inject"