# Conditional statement in expression tag

**URL:** <https://forum.inductiveautomation.com/t/conditional-statement-in-expression-tag/19714>\
**Category:** Ignition\
**Created:** [September 18, 2018, 2:14pm UTC](https://forum.inductiveautomation.com/t/conditional-statement-in-expression-tag/19714 "2018-09-18T14:14:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wschauer](https://avatars.discourse-cdn.com/v4/letter/w/ecccb3/32.png) [@wschauer](https://forum.inductiveautomation.com/u/wschauer)\
**Post date:** [September 18, 2018, 2:14pm UTC](https://forum.inductiveautomation.com/t/conditional-statement-in-expression-tag/19714/1 "2018-09-18T14:14:53Z")

</div>

I am trying to choose between values in an expression tag. Previously i have just created intermediate memory tags for this but from reading the manual this should be possible all in one step.  
I tag errors even when i use the actual value1.value

if {[.]value1} \< {[.]…/value2}:  
{[.]value1}+{[.]…/value2}  
else:  
{[.]…/value1}

Any help is appreciated.  
Thanks!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 18, 2018, 3:42pm UTC](https://forum.inductiveautomation.com/t/conditional-statement-in-expression-tag/19714/2 "2018-09-18T15:42:45Z")

</div>

[https://docs.inductiveautomation.com/display/DOC79/if](https://docs.inductiveautomation.com/display/DOC79/if)

So, something like this: `if({[.]value1} < {[.]../value2}, {[.]value1}+{[.]../value2}, {[.]../value1})`

---

<div class="post-metadata">

**Author:** ![wschauer](https://avatars.discourse-cdn.com/v4/letter/w/ecccb3/32.png) [@wschauer](https://forum.inductiveautomation.com/u/wschauer)\
**Post date:** [September 18, 2018, 5:22pm UTC](https://forum.inductiveautomation.com/t/conditional-statement-in-expression-tag/19714/3 "2018-09-18T17:22:02Z")

</div>

Great Thanks! works perfectly
