# Moving average of tag but only when another tag is on

**URL:** <https://forum.inductiveautomation.com/t/moving-average-of-tag-but-only-when-another-tag-is-on/56052>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [February 11, 2022, 10:35pm UTC](https://forum.inductiveautomation.com/t/moving-average-of-tag-but-only-when-another-tag-is-on/56052 "2022-02-11T22:35:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aykchoe](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@aykchoe](https://forum.inductiveautomation.com/u/aykchoe)\
**Post date:** [February 11, 2022, 10:35pm UTC](https://forum.inductiveautomation.com/t/moving-average-of-tag-but-only-when-another-tag-is-on/56052/1 "2022-02-11T22:35:29Z")

</div>

Looking for a way to get the moving average (timeserieschart) of a base tag but only when another conditional tag is on. I’m thinking I have to make another tag (dataset) that references the base tag and the conditional tag. Loop through each row and delete if the conditional tag is 0. Hope to hear some better suggestions. Thanks!
