# \[Bug\] Nighly 8.1.2 (2020-12-03) Perspective Power Chart Erronous Average

**URL:** <https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307>\
**Category:** Ignition Early Access\
**Created:** [December 8, 2020, 7:17pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307 "2020-12-08T19:17:10Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [December 8, 2020, 7:17pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/1 "2020-12-08T19:17:10Z")

</div>

So, I was trying to add a powerchart. For testing purpose, I added a Status (value 0-6). In the stats at the bottom, I noticed that the average was actually higher than the maximum. See the screenshot.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/7/67f1b8a30fa9270b707e01d76a27403244db50d8.png)

---

<div class="post-metadata">

**Author:** ![leonard.smit](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@leonard.smit](https://forum.inductiveautomation.com/u/leonard.smit)\
**Post date:** [December 9, 2020, 6:28am UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/2 "2020-12-09T06:28:20Z")

</div>

Hi Calimero

I thought this was maybe something to do with the Time weighted average calc, and the decided to add my own table with some aggregation methods as well. The min and max aggregation match but the average is way off?

This is in 8.1 not even on the nightly build.

 ![Screenshot 2020-12-09 at 08.24.22](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/58e50e87643146ae4267e0df443ab15add9753e1.png)

---

<div class="post-metadata">

**Author:** ![nathan.willbanks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nathan.willbanks/32/8489_2.png) [@nathan.willbanks](https://forum.inductiveautomation.com/u/nathan.willbanks)\
**Post date:** [December 9, 2020, 6:52pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/3 "2020-12-09T18:52:38Z")

</div>

I’m having a very similar issue. When I export the data & calculate averages through Excel, the numbers I get make a lot more sense & are no where near what Perspective is displaying. We’re currently running 8.1.0.

Note: as I watch my data right now, the average is actually continuing to climb despite already being well above maximum.

 ![Screenshot 2020-12-09 135159](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2b263f8bfd9bddd775d7afd78d2191e4de65b851.png)

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [December 30, 2020, 9:10am UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/4 "2020-12-30T09:10:16Z")

</div>

I’m running `8.1.0` and see the same bug.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [December 30, 2020, 9:00pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/5 "2020-12-30T21:00:02Z")

</div>

The problem is for the method historian use to compress data specially when there is no change in tag and you set the history mode to OnChange.  
In this mode history only log the change value of tag and in some cases there is small changes so there is not enough data for calculation of min max avg.  
The main bug is for the interpolation doesn’t work for aggregation functions.  
What I do most of the time I use system.tag.history and make it return enough point and interpolation is true.  
Then loop through the result and calculate min max avg in python.

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [January 11, 2021, 2:17pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/6 "2021-01-11T14:17:55Z")

</div>

Ok, the issue is really with the tag historian interpolation, even when it’s not needed. I have a value of SetSpeed, which is the actual speed the operator wants when the equipment is running. This value change once or twice a day. With the tag historian query, when not enough values, I seems to have an average of some sort, even when I select a different aggregation mode, LastValue being the aggregation mode I want

@nader.chinichian 2 questions:

- Do you have a sample of what you do?
- Do you have a query that replace tag historian query as in my case it messes with the data?

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 11, 2021, 5:06pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/7 "2021-01-11T17:06:46Z")

</div>

Hi  
I don’t understand your first question.  
Yes I have to use to get enough data with average aggregation mode and loop via dataset and cal want I want

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [January 11, 2021, 5:20pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/8 "2021-01-11T17:20:15Z")

</div>

Do you still use tag historian binding or you use a query binding?

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 12, 2021, 4:32am UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/9 "2021-01-12T04:32:40Z")

</div>

Tag history with return value to 500 and interpolation is on and aggregation lastvalue or average.  
Then loop through the result dataset by adding script transform.

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [January 12, 2021, 12:59pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/10 "2021-01-12T12:59:58Z")

</div>

I must be missing something here. Why doesn’t the average just work? I hope this is on IA’s radar to fix soon.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 12, 2021, 2:16pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/11 "2021-01-12T14:16:34Z")

</div>

We are not sure about average work correctly or not .  
People see number and if number is logical range they believe it is correct. But for min and max the value is totally can detect by naked eyes.

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [January 12, 2021, 3:00pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/12 "2021-01-12T15:00:44Z")

</div>

In my case, the average is outside min/max range, so obviously, it is not working as the average can’t be higher than the maximum

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [January 12, 2021, 3:42pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/13 "2021-01-12T15:42:58Z")

</div>

Just got this.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/4/a41adb0a6b3398f543f950460e9a16a1db6b8c03.png)

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 12, 2021, 4:30pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/14 "2021-01-12T16:30:20Z")

</div>

Yes as told before for now it’s better to cal statical value yourself till this fix

---

<div class="post-metadata">

**Author:** ![swolnisty](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@swolnisty](https://forum.inductiveautomation.com/u/swolnisty)\
**Post date:** [January 22, 2021, 6:43pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/15 "2021-01-22T18:43:31Z")

</div>

Just FYI, it looks like the average that gets displayed when you use the Range Brush feature of the power chart is correct. It’s not an ideal workaround, but at least it’s something.

---

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [January 27, 2021, 12:58am UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/16 "2021-01-27T00:58:40Z")

</div>

FYI… This bug was fixed for the 8.1.2 release. It was merged later in the month of December, so it wouldn’t have been part of the nightly listed in the title if this post.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 27, 2021, 4:57am UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/17 "2021-01-27T04:57:32Z")

</div>

Hi Jashua,  
I also see this bug with system.tag.history function which give wrong value some times depend on points available in database. Will this fix include for system.tag functions or not?

---

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [January 27, 2021, 6:25pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/18 "2021-01-27T18:25:08Z")

</div>

Hi Nader, this fix was done only at the chart level (improper average calculation within the component). If you can provide a repeatable test of the issue you’re having with `system.tag.history`, I’ll open up a ticket for it.

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [September 13, 2021, 12:45pm UTC](https://forum.inductiveautomation.com/t/bug-nighly-8-1-2-2020-12-03-perspective-power-chart-erronous-average/41307/19 "2021-09-13T12:45:53Z")

</div>

The issue is still there in French, but works in English.

An issue with the Locale??
