# How to locate the number 'value' of a Tag's Data Quality

**URL:** <https://forum.inductiveautomation.com/t/how-to-locate-the-number-value-of-a-tags-data-quality/26840>\
**Category:** Ignition\
**Created:** [July 24, 2019, 5:13pm UTC](https://forum.inductiveautomation.com/t/how-to-locate-the-number-value-of-a-tags-data-quality/26840 "2019-07-24T17:13:21Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 13, 2021, 4:00pm UTC](https://forum.inductiveautomation.com/t/how-to-locate-the-number-value-of-a-tags-data-quality/26840/16 "2021-08-13T16:00:28Z")

</div>

Reviving this thread because of changes that landed in the latest nightly build/8.1.10:

> [@Nightly 8.1 Changelogs - 2021](https://forum.inductiveautomation.com/t/nightly-8-1-changelogs-2021/42410/137):
>
> Nightly Changelog: 8.1.10-b20210813 Platform 3512: Old MySQL drivers prevent Gateway startup if using alarm journal profile An old installed MySQL JDBC driver (prior to v5.1.0) no longer prevents the Gateway from fully starting when having an alarm journal configured. 388: Improve handling of QualifiedValues/QualityCodes in expressions Added the following expression functions: isUncertain isBad isError isBadOrError qualityOf timestampOf In addition, overloaded the equality operation in exp…

The gist: In addition to `isGood`, we've added new expression functions to test each different level (`isBad`, `isUncertain`, `isError`).

As a further mechanism to allow direct comparison, e.g. if you want to find out if something is disabled, you can use the new `qualityOf` expression; this will return the QualityCode object from the input. The equality operator has been 'overloaded' for QualityCodes in expressions, so you can directly compare against the (modern) string constants or integer values:  
`qualityOf({tag}) = 515`  
or  
`qualityOf({tag}) = "Bad_Disabled"`

Note that any value outside of the 'reserved' 0-1024 range for IA codes will need to be the somewhat opaque 32-bit integer code. It's a mask on the most-significant 2 bits of a 32 bit value (representing the level; `Good(0b00), Uncertain(0b01), Bad(0b10), Error(0b11)`) and the 'user code', which can be any other integer value. This is unlikely to matter to anyone unless they're using a module that implements their own custom QualityCodes.

Scripting is not affected by these changes, so the `getCode()` mechanism above detailed higher in the thread is still the 'best' way to store modern codes into a database.

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-locate-the-number-value-of-a-tags-data-quality/26840)._
