# Groov I/O Read node results unusable with math operators

**URL:** https://discourse.nodered.org/t/groov-i-o-read-node-results-unusable-with-math-operators/56416
**Category:** General
**Created:** [10 January 2022 18:05 UTC](https://discourse.nodered.org/t/groov-i-o-read-node-results-unusable-with-math-operators/56416 "2022-01-10T18:05:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![rpabbv117](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@rpabbv117](https://discourse.nodered.org/u/rpabbv117)
#### Post date: [10 January 2022 18:05 UTC](https://discourse.nodered.org/t/groov-i-o-read-node-results-unusable-with-math-operators/56416/1 "2022-01-10T18:05:51Z")

</div>

Hello all,

I was trying to do a simple subtraction of two results from groov I/O read nodes in a function node, but the result seems to always be NaN when the two read node results interact. Thoughts? Will clarify further if necessary.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [10 January 2022 18:17 UTC](https://discourse.nodered.org/t/groov-i-o-read-node-results-unusable-with-math-operators/56416/2 "2022-01-10T18:17:41Z")

</div>

Well NAN means Not A Number so there is something wrong with your data or code.

It would be helpful if you provided the function node and a debug list of the data going into the function node.

---

<div class="post-metadata">

### Author: ![rpabbv117](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@rpabbv117](https://discourse.nodered.org/u/rpabbv117)
#### Post date: [10 January 2022 18:31 UTC](https://discourse.nodered.org/t/groov-i-o-read-node-results-unusable-with-math-operators/56416/3 "2022-01-10T18:31:37Z")

</div>

![Function Dew](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/a/7ab3f1aeaf67cefcc7059f02a3a55e00adebbc2d.png)  
 ![Output Dew](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/0/2045d1a6f6ce3d9d284c2f171d79354d5b394e92.png)

My apologies for not including these in my initial post, and I appreciate the quick reply! I tried to include all relevant nodes, but if there is something you see is missing, let me know.

---

<div class="post-metadata">

### Author: ![rpabbv117](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@rpabbv117](https://discourse.nodered.org/u/rpabbv117)
#### Post date: [10 January 2022 18:32 UTC](https://discourse.nodered.org/t/groov-i-o-read-node-results-unusable-with-math-operators/56416/4 "2022-01-10T18:32:13Z")

</div>

![Debud Node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f156aeecc5b3d7908c0cb9ca8830b7a6ec97e80e.png)  
 ![RH Read](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/2/62f55fdd7de7020036f99e18b920ddec98947d15.png)

---

<div class="post-metadata">

### Author: ![rpabbv117](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@rpabbv117](https://discourse.nodered.org/u/rpabbv117)
#### Post date: [10 January 2022 18:32 UTC](https://discourse.nodered.org/t/groov-i-o-read-node-results-unusable-with-math-operators/56416/5 "2022-01-10T18:32:46Z")

</div>

![Temperature Read](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e92053de2d626d9754f63cae46117e399fbe6170.png)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [10 January 2022 18:47 UTC](https://discourse.nodered.org/t/groov-i-o-read-node-results-unusable-with-math-operators/56416/6 "2022-01-10T18:47:21Z")

</div>

You have two different msgs going thru the function node at different times. So when the first msg arrives (the one with `Rh`) arrives msg.Temp doesn’t exist and you get the NAN.

You need to `join` the two msgs to get all the data in one msg before sending it to the `function` to be processed.

Take a look at the `join` node.

---

<div class="post-metadata">

### Author: ![rpabbv117](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@rpabbv117](https://discourse.nodered.org/u/rpabbv117)
#### Post date: [10 January 2022 19:04 UTC](https://discourse.nodered.org/t/groov-i-o-read-node-results-unusable-with-math-operators/56416/7 "2022-01-10T19:04:57Z")

</div>

Thanks for the tip, did some experimenting and got it to work!

---

<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: [24 January 2022 19:05 UTC](https://discourse.nodered.org/t/groov-i-o-read-node-results-unusable-with-math-operators/56416/8 "2022-01-24T19:05:43Z")

</div>

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