# Expression Tag / if condition third tag

**URL:** <https://forum.inductiveautomation.com/t/expression-tag-if-condition-third-tag/83722>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [January 3, 2024, 7:45am UTC](https://forum.inductiveautomation.com/t/expression-tag-if-condition-third-tag/83722 "2024-01-03T07:45:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Purushothaman\_R](https://avatars.discourse-cdn.com/v4/letter/p/8797f3/32.png) [@Purushothaman\_R](https://forum.inductiveautomation.com/u/Purushothaman_R)\
**Post date:** [January 3, 2024, 7:45am UTC](https://forum.inductiveautomation.com/t/expression-tag-if-condition-third-tag/83722/1 "2024-01-03T07:45:24Z")

</div>

Hi guys, can you help me how we can write this expression for third tag for two tags it is working fine so how we can write expression for the third tag

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/f/9f03e68c9bff9a32efa4af5a2532d6781853198f.png)

> `if` `({tag1} > ` `0` `, ` `if` `({tag2} > ` `0` `, ` `"Both Tags are positive."` `, ` `"Tag 1 is positive."` `), ` `if` `({tag2} > ` `0` `, ` `"Tag 2 is positive."` `, ` `"Neither Tag is positive."` `))`

i will pastte the link here for the manual [if - Ignition User Manual 7.9 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC79/if)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 3, 2024, 10:23am UTC](https://forum.inductiveautomation.com/t/expression-tag-if-condition-third-tag/83722/2 "2024-01-03T10:23:02Z")

</div>

```auto
case(
    binEnc({tag1}, {tag2}, {tag3}),
    1, "Tag1 is positive.",
    2, "Tag2 is positive.",
    3, "Tag1 and 2 are positive.",
    4, "Tag3 is positive.",
    5, "Tag1 and 3 are positive.",
    6, "Tag2 and 3 are positive.",
    7, "Tag1, 2 and 3 are positive.",
    "No tag is positive."
)

```

[https://docs.inductiveautomation.com/display/DOC81/binEnc](https://docs.inductiveautomation.com/display/DOC81/binEnc)

[https://docs.inductiveautomation.com/display/DOC81/case](https://docs.inductiveautomation.com/display/DOC81/case)

See also, [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831)

---

<div class="post-metadata">

**Author:** ![Purushothaman\_R](https://avatars.discourse-cdn.com/v4/letter/p/8797f3/32.png) [@Purushothaman\_R](https://forum.inductiveautomation.com/u/Purushothaman_R)\
**Post date:** [January 4, 2024, 4:51am UTC](https://forum.inductiveautomation.com/t/expression-tag-if-condition-third-tag/83722/3 "2024-01-04T04:51:25Z")

</div>

It worked. Thank you !
