# Ignoring Bad Tags in an Expression

**URL:** <https://forum.inductiveautomation.com/t/ignoring-bad-tags-in-an-expression/35828>\
**Category:** Ignition\
**Created:** [June 19, 2020, 12:19pm UTC](https://forum.inductiveautomation.com/t/ignoring-bad-tags-in-an-expression/35828 "2020-06-19T12:19:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stan.cook](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stan.cook/32/10553_2.png) [@stan.cook](https://forum.inductiveautomation.com/u/stan.cook)\
**Post date:** [June 19, 2020, 12:19pm UTC](https://forum.inductiveautomation.com/t/ignoring-bad-tags-in-an-expression/35828/1 "2020-06-19T12:19:13Z")

</div>

I have an expression tag which I want to be the minimum time left in cycle for a group of ovens. I am using the “min” function on a group of “if” statements that each test if an oven is in cycle and return either Null of the cycle time. That all works well, until…

But when I try to include an oven that is currently powered down (with all bad quality tags) the expression result is also bad. I need to be able to test if the oven tag is bad and if so, just put a Null in the “min” expression. However I am failing at this task. I tried testing with “isGood” but even that caused a bad expression quality.

I’m hoping I am missing something obvious.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 19, 2020, 12:30pm UTC](https://forum.inductiveautomation.com/t/ignoring-bad-tags-in-an-expression/35828/2 "2020-06-19T12:30:13Z")

</div>

You missed the [forceQuality](https://docs.inductiveautomation.com/display/DOC80/forceQuality) expression function…

---

<div class="post-metadata">

**Author:** ![stan.cook](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stan.cook/32/10553_2.png) [@stan.cook](https://forum.inductiveautomation.com/u/stan.cook)\
**Post date:** [June 19, 2020, 12:36pm UTC](https://forum.inductiveautomation.com/t/ignoring-bad-tags-in-an-expression/35828/3 "2020-06-19T12:36:27Z")

</div>

I did miss it, but I am sure I understand how to apply it. I do want to react to the bad quality (put a Null in my minimum calculation). If I use whatever value is left in the tag, I could erroneously include a cycle time that is old/stale.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 19, 2020, 12:37pm UTC](https://forum.inductiveautomation.com/t/ignoring-bad-tags-in-an-expression/35828/4 "2020-06-19T12:37:33Z")

</div>

Use both isGood() and forceQuality() in your logic.

---

<div class="post-metadata">

**Author:** ![stan.cook](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stan.cook/32/10553_2.png) [@stan.cook](https://forum.inductiveautomation.com/u/stan.cook)\
**Post date:** [June 19, 2020, 2:15pm UTC](https://forum.inductiveautomation.com/t/ignoring-bad-tags-in-an-expression/35828/5 "2020-06-19T14:15:23Z")

</div>

Thanks for your help. I suspect I was doing something wrong elsewhere in the expression as it works fine now with “isGood”. I can’t reproduce my initial error.
