# Script help

**URL:** <https://forum.inductiveautomation.com/t/script-help/10024>\
**Category:** Ignition\
**Created:** [May 14, 2015, 7:28pm UTC](https://forum.inductiveautomation.com/t/script-help/10024 "2015-05-14T19:28:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darrell.henley](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@darrell.henley](https://forum.inductiveautomation.com/u/darrell.henley)\
**Post date:** [May 14, 2015, 7:28pm UTC](https://forum.inductiveautomation.com/t/script-help/10024/1 "2015-05-14T19:28:15Z")

</div>

I’m trying to create an expression to set a value for a property tag  
the first line works but the second causes an error.

if({Madera/TF2\_Controller/TANK801}\>{Madera/TF2\_Controller/TANK801Hsp},1,0)  
if({Madera/TF2\_Controller/TANK801}\<{Madera/TF2\_Controller/TANK801Lsp},2,0)

---

<div class="post-metadata">

**Author:** ![Duffanator](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/duffanator/32/3560_2.png) [@Duffanator](https://forum.inductiveautomation.com/u/Duffanator)\
**Post date:** [May 14, 2015, 7:34pm UTC](https://forum.inductiveautomation.com/t/script-help/10024/2 "2015-05-14T19:34:31Z")

</div>

You have to nest them, you can’t have two separate if statements in an expression. So it would be like this:

`if({Madera/TF2_Controller/TANK801}>{Madera/TF2_Controller/TANK801Hsp},
1,
if({Madera/TF2_Controller/TANK801}<{Madera/TF2_Controller/TANK801Lsp},
2,
0))`

---

<div class="post-metadata">

**Author:** ![darrell.henley](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@darrell.henley](https://forum.inductiveautomation.com/u/darrell.henley)\
**Post date:** [May 14, 2015, 8:47pm UTC](https://forum.inductiveautomation.com/t/script-help/10024/3 "2015-05-14T20:47:56Z")

</div>

Picky thing this script. I typed it as it looked but I may have had a space wrong. I copied it and pasted it and it worked.

Thanks, Now to figure out how to do indirect tags for popup chart.

I have 4 tags SP, HL, LL, Temp
