I'm currently working on the Statistics Node, but I think my question is not Statistics-specific.
To make the node work, the node has a property called 'dataSetSize'. As long as I set this value directly on the node everything is working properly but, I need to set this property from my flow. How can i do this?
My goal is to calculate the Mean and the StandardDeviation of the incoming payload where the array-length can by anything. Maybe there is a better way to do this in javascript? Any suggestions?
I haven't used that node, but I think the description says that if you specify clear when you pass the array then it will clear any existing data, add in the new array of values, and calculate the answer for you.
Yes, I checked that msg.topic = clear will celar the register. But msg.topic is also necessary to specify the kind of math you are doing, for example standardDeviation. Then things gets messy....
I just installed that node and it seems to work fine.
I understood that the whole input array will be used in the calculation when the parameter Data set size is left as zero.
maximum number of data elements to store. 0 for unlimited.
The trick (as you already mentioned) is to set the topic of the message to the function to be applied, in your case "mean" or "standardDeviation"
Edit: After playing a while with the node I understand what you mean. Indeed, it is not intuitive controlling the behaviour of the node. Still trying to get my head round.