# Smooth Node incoming data

**URL:** <https://discourse.nodered.org/t/smooth-node-incoming-data/64412>\
**Category:** General\
**Created:** [27 June 2022 11:39 UTC](https://discourse.nodered.org/t/smooth-node-incoming-data/64412 "2022-06-27T11:39:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FeliceM](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@FeliceM](https://discourse.nodered.org/u/FeliceM)\
**Post date:** [27 June 2022 11:39 UTC](https://discourse.nodered.org/t/smooth-node-incoming-data/64412/1 "2022-06-27T11:39:22Z")

</div>

I would like to use the smooth node to get the std deviation.  
I have a string of data, similar to this one but with 32 values, streamed every 10 seconds:

> 12.747:12.884:12.672:12.909

Is there a way to pass all 32 values to the node rather than one by one selecting the "over the most recent xx values?

Thanks

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [27 June 2022 12:52 UTC](https://discourse.nodered.org/t/smooth-node-incoming-data/64412/2 "2022-06-27T12:52:18Z")

</div>

You could preform the calculation in a change node or function node.

```auto
[{"id":"7aa1c827.66c4a8","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"12.747:12.884:12.672:12.909","payloadType":"str","x":170,"y":220,"wires":[["9eacf013.71837"]]},{"id":"9eacf013.71837","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"(\t $array := $split($$.payload, \":\").$number($);\t $array_count := $count($array);\t $mean := $average($array);\t {\t \"sample_sd\":$sqrt($sum($array.( $power($mean - $, 2) ) )/($array_count-1)),\t \"sd\":$sqrt($sum($array.( $power($mean - $, 2) ) )/$array_count)\t }\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":220,"wires":[["d9d457b0.f0ad4"]]},{"id":"d9d457b0.f0ad4","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":160,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![FeliceM](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@FeliceM](https://discourse.nodered.org/u/FeliceM)\
**Post date:** [27 June 2022 12:57 UTC](https://discourse.nodered.org/t/smooth-node-incoming-data/64412/3 "2022-06-27T12:57:49Z")

</div>

Thats brilliant!

Thanks a lot

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 July 2022 12:58 UTC](https://discourse.nodered.org/t/smooth-node-incoming-data/64412/4 "2022-07-11T12:58:24Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
