# Tag DataQuality to Int

**URL:** <https://forum.inductiveautomation.com/t/tag-dataquality-to-int/11433>\
**Category:** Ignition\
**Created:** [March 29, 2016, 11:17pm UTC](https://forum.inductiveautomation.com/t/tag-dataquality-to-int/11433 "2016-03-29T23:17:11Z")\
**Posts on this page:** 2\
**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:** [March 29, 2016, 11:17pm UTC](https://forum.inductiveautomation.com/t/tag-dataquality-to-int/11433/1 "2016-03-29T23:17:11Z")

</div>

I’m sure I need to convert the dataquality of a tag to an Int to evaluate it and give me an Int out but I’m having problems getting to toint to work. I’m sure I’m missing something.  
Can anybody help out.

toint ([.]tag.Quality)

if ([.]tag.Quality=1,1,0)

What I want is if tag quality is good then 1 else 0

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [March 30, 2016, 3:10am UTC](https://forum.inductiveautomation.com/t/tag-dataquality-to-int/11433/2 "2016-03-30T03:10:52Z")

</div>

You need to use 192 instead of 1 in your expression. 192 correlates to good taq quality. tag quality represents many different states, not just good or bad.

[docs.inductiveautomation.com/di … d+Overlays](https://docs.inductiveautomation.com/display/DOC/Tag+Quality+and+Overlays)
