# Value between x and y replacing with different condition

**URL:** <https://forum.dynamobim.com/t/value-between-x-and-y-replacing-with-different-condition/8130>\
**Category:** Lists-Logic\
**Created:** [December 9, 2016, 1:33pm UTC](https://forum.dynamobim.com/t/value-between-x-and-y-replacing-with-different-condition/8130 "2016-12-09T13:33:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Berend\_Prinsen](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Berend\_Prinsen](https://forum.dynamobim.com/u/Berend_Prinsen)\
**Post date:** [December 9, 2016, 1:33pm UTC](https://forum.dynamobim.com/t/value-between-x-and-y-replacing-with-different-condition/8130/1 "2016-12-09T13:33:10Z")

</div>

Hello everyone,

I am trying to replace values by a condition. And that condition has a between value. So from 0 to 4200 I want to replace with a 1, from 4200 to 8000 with a 2, etc. It sounds manageble, but i’m not able to figure this one out.  
Can someone help me with this?

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/c/9c0c43cb4ae0a5073dd528c9ad7205dddf45a8f7.PNG)

Tnx very much, Berend.

---

<div class="post-metadata">

**Author:** ![jostein\_olsen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jostein_olsen/32/8570_2.png) [@jostein\_olsen](https://forum.dynamobim.com/u/jostein_olsen)\
**Post date:** [December 9, 2016, 2:19pm UTC](https://forum.dynamobim.com/t/value-between-x-and-y-replacing-with-different-condition/8130/2 "2016-12-09T14:19:42Z")

</div>

dependent on how long your predicate list is you can use this syntax in Designscript.

test?value if true:value if false. Can also work nested like this:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/7/d7dfcfcc9a05ccaba15c072efa2b3328b6b4a504.png)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [December 9, 2016, 2:36pm UTC](https://forum.dynamobim.com/t/value-between-x-and-y-replacing-with-different-condition/8130/3 "2016-12-09T14:36:24Z")

</div>

[replace.dyn](https://forum.dynamobim.com/uploads/short-url/jmqIxnh36GdgqCi6SbJYu1EOL5d.dyn) (8.9 KB)  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/9/292d121894aa958a84b476701ef1bfb26dd94f58.png)

---

<div class="post-metadata">

**Author:** ![Berend\_Prinsen](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Berend\_Prinsen](https://forum.dynamobim.com/u/Berend_Prinsen)\
**Post date:** [December 9, 2016, 3:07pm UTC](https://forum.dynamobim.com/t/value-between-x-and-y-replacing-with-different-condition/8130/4 "2016-12-09T15:07:12Z")

</div>

Tnx Vikram,

To compare the values by two different bigger or smaller nodes and then when both are true -\> euraka!

I wanted to do this 1 one step and was only thinking about that.

Many many tnx,

Berend.
