# Indirect tags in if expression or binenc

**URL:** <https://forum.inductiveautomation.com/t/indirect-tags-in-if-expression-or-binenc/12325>\
**Category:** Ignition\
**Created:** [November 2, 2016, 11:12pm UTC](https://forum.inductiveautomation.com/t/indirect-tags-in-if-expression-or-binenc/12325 "2016-11-02T23:12:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trentbliss](https://avatars.discourse-cdn.com/v4/letter/t/e19b73/32.png) [@trentbliss](https://forum.inductiveautomation.com/u/trentbliss)\
**Post date:** [November 2, 2016, 11:12pm UTC](https://forum.inductiveautomation.com/t/indirect-tags-in-if-expression-or-binenc/12325/1 "2016-11-02T23:12:48Z")

</div>

Hi

i have the following for a popup window  
coalesce(  
if ({Tags/test1} = 0 && {Tags/test2} = 0, “0”,None),  
if ({Tags/test1} = 1 && {Tags/test2} = 0, “1”,None),  
if ({Tags/test1} = 0 && {Tags/test2} = 1, “2”,None),  
if ({Tags/test1} = 1 && {Tags/test2} = 1, “3”,None))  
or  
Binenc({Tags/test1},{Tags/test2})

i cant get an indirect tag into these statements keeps saying cant use nested or not and argument.

any help please

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 3, 2016, 1:16pm UTC](https://forum.inductiveautomation.com/t/indirect-tags-in-if-expression-or-binenc/12325/2 "2016-11-03T13:16:32Z")

</div>

I have had the same issue.

This, however, should work:

```auto
toInt(coalesce({Tags/test1},0)) + 2*toInt(coalesce({Tags/test2},0))
```

if you’re not worried about null values from the tags, it can be shortened to:

```auto
toInt({Tags/test1}) + 2*toInt({Tags/test2})
```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 3, 2016, 1:36pm UTC](https://forum.inductiveautomation.com/t/indirect-tags-in-if-expression-or-binenc/12325/3 "2016-11-03T13:36:15Z")

</div>

Sorry, forgotten that I had done this. 😊

I had made a UDT that does the same thing using the same workaround. Up to 32 bits.
