# Tag History algorithm bug

**URL:** <https://forum.inductiveautomation.com/t/tag-history-algorithm-bug/111175>\
**Category:** Ignition\
**Created:** [October 3, 2025, 3:43pm UTC](https://forum.inductiveautomation.com/t/tag-history-algorithm-bug/111175 "2025-10-03T15:43:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsonnicksen](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rsonnicksen](https://forum.inductiveautomation.com/u/rsonnicksen)\
**Post date:** [October 3, 2025, 3:43pm UTC](https://forum.inductiveautomation.com/t/tag-history-algorithm-bug/111175/1 "2025-10-03T15:43:19Z")

</div>

I’m struggling to get EasyCharts to display accurate analog history data.

The data compression algorithm is not (IMHO) working as it should. The description of the algorithm is a bit vague when it refers to “previous value” I’m not sure if it’s referring to the previously logged value, or the previously scanned value. In either case, the algorithm doesn’t work as it should.

I’ve historized two idential tags. One has a 10 minute Max Time Between Samples, and the other has a 5 second Max Time Between Samples

 ![history_tags](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/29bef221f4b4211852713c330fa9a92af60d61d0.png)

In the slower trend, the final change to value 74 is shown as a linear interpolation over the Max Time Between Intervals time span. I don’t think this is what anyone wants from their trend data. The history compression algorithm should have immediately logged a value to the database when the value dropped to 74.  
The solution “could” be:

- Log the initial point to the database when history is enabled
- Monitor the tag and log a second point when the scanned value deviates by more than the deadband.
- Use the last two logged points to create a parallelogram around those two points with the upper and lower sides based on the +/- deadband. Extrapolate those two lines into the future.
- If the scanned value crosses either the upper or lower side extrapolation, log the 2nd to the last scanned value (before it crossed the limit).
- Re-calculate the parallelogram based on the new logged value and the previous logged value.
- Repeat.  
This method WILL cause more records to be written, but will actually provide accurate data which is much more important than the database size.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [October 3, 2025, 3:55pm UTC](https://forum.inductiveautomation.com/t/tag-history-algorithm-bug/111175/2 "2025-10-03T15:55:19Z")

</div>

Looks like you may be running into this issue.

> [@Power Chart Interpolation](https://forum.inductiveautomation.com/t/power-chart-interpolation/111041/6):
>
> This topic came up a lot during training sessions. The main reason I've found that causes this is actually in the tag historical configuration, specifically the deadband style property. There are three options, auto (default), Analog and Discrete. Auto will choose either Analog or Discrete based on the tag type. Basically anything with a floating point is set to analog. An analog deadband style always assumes a linear path. Think of temperature, it's impossible to jump from one temp to anothe…

Yes I know the linked thread is primarily about the perspective Power Chart, but if you scroll down you will see that people see the same issue with the Easy Chart. That and the actual issue in that thread was a tag configuration issue.

---

<div class="post-metadata">

**Author:** ![rsonnicksen](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rsonnicksen](https://forum.inductiveautomation.com/u/rsonnicksen)\
**Post date:** [October 3, 2025, 4:15pm UTC](https://forum.inductiveautomation.com/t/tag-history-algorithm-bug/111175/3 "2025-10-03T16:15:24Z")

</div>

Thanks for the heads up to that post.

I’ll be using Discrete deadband style in the future.

---

<div class="post-metadata">

**Author:** ![robertm](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@robertm](https://forum.inductiveautomation.com/u/robertm)\
**Post date:** [October 3, 2025, 5:00pm UTC](https://forum.inductiveautomation.com/t/tag-history-algorithm-bug/111175/4 "2025-10-03T17:00:01Z")

</div>

This needs to be a sticky…I started setting all analog tags to discrete about 3 years ago because of this very behaviour. I’m not sure either the use case for the way it operates in analog/auto.
