# RBE/Filter node: definition of "last input value"

**URL:** <https://discourse.nodered.org/t/rbe-filter-node-definition-of-last-input-value/72115>\
**Category:** General\
**Created:** [13 December 2022 10:19 UTC](https://discourse.nodered.org/t/rbe-filter-node-definition-of-last-input-value/72115 "2022-12-13T10:19:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![binderth](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/binderth/32/35124_2.png) [@binderth](https://discourse.nodered.org/u/binderth)\
**Post date:** [13 December 2022 10:19 UTC](https://discourse.nodered.org/t/rbe-filter-node-definition-of-last-input-value/72115/1 "2022-12-13T10:19:26Z")

</div>

as described here

> [@Remove / smoothen unrealistic item values which randomly appear](https://discourse.nodered.org/t/remove-smoothen-unrealistic-item-values-which-randomly-appear/62971/5):
>
> so update: It seems to work flawlessly. Usually, there's at least one or two drops within a few hours, and right until now it's not happened anymore! Great!

I used the RBE/filter node to ignore values that have changed by \>25% since **last input value**.

So question: "last input value" corresponding to the last _accepted_ input value? or the very last input value _at all_ - even if unaccepted?

Let's assume the following input values:

1. 20
2. 22
3. 40
4. 45
5. 45

So, the second input value gets accepted (it's only 10% more), but the third input value gets ignored, because it's \>25% change.

So question is to clarify:

- 45 is accepted again, because it's \<25% change to 40?

> **RBE/Filter node**
>
> ```auto
> [
> {
> "id": "e8d801ca77ee111a",
> "type": "rbe",
> "z": "58c52084.f5de9",
> "name": "unrealistisch raus",
> "func": "narrowbandEq",
> "gap": "25%",
> "start": "",
> "inout": "in",
> "septopics": true,
> "property": "payload",
> "topi": "topic",
> "x": 950,
> "y": 340,
> "wires": [
> [
> "acfcaafe.4d56a"
> ]
> ]
> }
> ]
> 
> ```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 December 2022 16:06 UTC](https://discourse.nodered.org/t/rbe-filter-node-definition-of-last-input-value/72115/2 "2022-12-13T16:06:36Z")

</div>

> [@binderth](#):
>
> So question: "last input value" corresponding to the last _accepted_ input value? or the very last input value _at all_ - even if unaccepted?

Isn't the last accepted input value the same as the last output value?

---

<div class="post-metadata">

**Author:** ![binderth](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/binderth/32/35124_2.png) [@binderth](https://discourse.nodered.org/u/binderth)\
**Post date:** [13 December 2022 17:10 UTC](https://discourse.nodered.org/t/rbe-filter-node-definition-of-last-input-value/72115/3 "2022-12-13T17:10:47Z")

</div>

> [@Colin](#):
>
> Isn't the last accepted input value the same as the last output value?

nope. The RBE-node filters values, which don't meet the conditions in it. So, in my example the "last output value" in step 3 will be that of step 2: 22. BUT the "last output value" of step 4 is still 22.

So, to sharpen my question: is the "last input value" really just that: the last input - regardless of the filter condition? or is it the last "accepted" input value. In the latter case, it's kinda useless for my use case - but I'll get the impression as the output values tend to not change... I'll have to log everything to be sure (that's why I ask here first)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 December 2022 18:48 UTC](https://discourse.nodered.org/t/rbe-filter-node-definition-of-last-input-value/72115/4 "2022-12-13T18:48:51Z")

</div>

I figured a minute's experimentation was better than hours in the forum so I tried it.  
Is this the filter node settings?

 ![Untitled 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a5e62f3505765f12c2e58ee9390a0ac229ef52cd.jpeg)  
 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f18eb72a7ff3bf1508438e4626ecdddc1322fca9.jpeg)  
I conclude that the "last input value" really is just that: the last input.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 December 2022 21:46 UTC](https://discourse.nodered.org/t/rbe-filter-node-definition-of-last-input-value/72115/5 "2022-12-13T21:46:55Z")

</div>

> [@binderth](#):
>
> > [@Colin](#):
> >
> > Isn't the last accepted input value the same as the last output value?
> 
> nope. The RBE-node filters values, which don't meet the conditions in it. So, in my example the "last output value" in step 3 will be that of step 2: 22. BUT the "last output value" of step 4 is still 22.

So what is the 'last accepted input value` at steps 3 and 4?

---

<div class="post-metadata">

**Author:** ![binderth](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/binderth/32/35124_2.png) [@binderth](https://discourse.nodered.org/u/binderth)\
**Post date:** [13 December 2022 23:47 UTC](https://discourse.nodered.org/t/rbe-filter-node-definition-of-last-input-value/72115/6 "2022-12-13T23:47:40Z")

</div>

> [@jbudd](#):
>
> I conclude that the "last input value" really is just that: the last input.

Thanks for that test! Appreciated!

> [@Colin](#):
>
> So what is the 'last accepted input value` at steps 3 and 4?

That was the question. But as jbudd kindly demonstrated, it should work as intended. I'll have to look elsewhere for the cause of my "flatline".

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 December 2022 09:18 UTC](https://discourse.nodered.org/t/rbe-filter-node-definition-of-last-input-value/72115/7 "2022-12-14T09:18:36Z")

</div>

> [@binderth](#):
>
> That was the question.

In your first post you asked

> [@binderth](#):
>
> So question: "last input value" corresponding to the last _accepted_ input value? or the very last input value _at all_ - even if unaccepted?

It is clear what is meant by 'very last input value at all', but I don't understand what you meant by 'last accepted input value'. I suggested that you mean the last value passed on (which is the last output value) but you said no. So what did you mean by 'last accepted input value' if it is not the previous value passed in and is not the last value passed on.

---

<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:** [28 December 2022 09:18 UTC](https://discourse.nodered.org/t/rbe-filter-node-definition-of-last-input-value/72115/8 "2022-12-28T09:18:48Z")

</div>

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