A process average has no valid denominator when there are no samples. Guard division before evaluating it and assign the specified fallback in the other branch. Leaving the old result unchanged can present stale information as a new measurement. The test changes from valid data to a zero denominator so that retained values become visible.
First calculate a valid average, then change the sample count to zero. A missing ELSE leaves the earlier average displayed. An unguarded division produces a numeric error. These are separate defects: one shows stale process information and the other cannot produce a finite result at all.
Read the tag list and the requested sequence before editing.