# Quality of Tags For Calculations

**URL:** <https://forum.inductiveautomation.com/t/quality-of-tags-for-calculations/75841>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [July 3, 2023, 12:14pm UTC](https://forum.inductiveautomation.com/t/quality-of-tags-for-calculations/75841 "2023-07-03T12:14:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sameer\_Ambegaonkar](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@Sameer\_Ambegaonkar](https://forum.inductiveautomation.com/u/Sameer_Ambegaonkar)\
**Post date:** [July 3, 2023, 12:14pm UTC](https://forum.inductiveautomation.com/t/quality-of-tags-for-calculations/75841/1 "2023-07-03T12:14:21Z")

</div>

Looks like the python scripting functions (for e.g. mean, max..etc) don't consider the quality status (good or bad) of the tag for calculations. They only do justice to tags with good quality. Only way I think is to write scripts to check for quality of tags and perform functions. Is there any other way out?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 3, 2023, 1:13pm UTC](https://forum.inductiveautomation.com/t/quality-of-tags-for-calculations/75841/2 "2023-07-03T13:13:33Z")

</div>

Well it's not too hard nor too long to do something like this:

```python
values_expr = (qval.value for qval in your_tags if qval.quality.good)
return sum(values_expr)

```

---

<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:** [July 3, 2023, 1:21pm UTC](https://forum.inductiveautomation.com/t/quality-of-tags-for-calculations/75841/3 "2023-07-03T13:21:46Z")

</div>

Every tag read system function delivers a `QualifiedValue` object for you to inspect. Many scripts just take the `.value` of it immediately, but you aren't required to do so. Inspect each `.quality` as you wish.
