# Tag history queries are kind of messed up

**URL:** <https://forum.inductiveautomation.com/t/tag-history-queries-are-kind-of-messed-up/57164>\
**Category:** Ignition\
**Created:** [March 14, 2022, 3:36pm UTC](https://forum.inductiveautomation.com/t/tag-history-queries-are-kind-of-messed-up/57164 "2022-03-14T15:36:22Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [March 14, 2022, 3:36pm UTC](https://forum.inductiveautomation.com/t/tag-history-queries-are-kind-of-messed-up/57164/1 "2022-03-14T15:36:22Z")

</div>

Hello folks,

I’m trying to figure out what’s going on with tag history. I’m on 8.1.10.  
The results for `pointCount` and `periodic` queries are utterly wrong. I’m comparing the results of the different modes and here’s what I find:  
`asStored`: I get about 330 points, with values that make sense

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/d/5dcbd7e41050c9377a9b78ea6e856dd432b2dcfa.png)

`pointCount`, set on 500 points:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/3/63cd439000c96d2ac2f09a7207a1c94021b9b51c.png)

`pointCount` starts looking like `asStored` when configured on \> ~12000 points:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/1/8121e439da9aac57c8c4323104db42874d381362.png)

`periodic` looks exactly like `pointCount` when set for intervals above ~45 seconds, and behaves properly for shorter intervals.

This is quite upsetting when using powerChart, as I’d need to set it to ~12000 points to get the proper display, when it seems about 330 points are enough, as shown by `asStored` !

What’s up with that ? Am I missing something ? Can someone explain to me what’s going on or how to fix it ?

Thank you in advance, and have a wonderful day !

Edit: So it appears I cannot put images in a `<details>` block. Huh.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [March 14, 2022, 11:42pm UTC](https://forum.inductiveautomation.com/t/tag-history-queries-are-kind-of-messed-up/57164/2 "2022-03-14T23:42:21Z")

</div>

This sounds like a problem with the interpolation the power chart is doing, which from what i understand is one of the frustrations with power charts.

Your tag history is probably fine, what do you get if you use a time series chart and a tag history data source?

---

<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:** [March 15, 2022, 8:40am UTC](https://forum.inductiveautomation.com/t/tag-history-queries-are-kind-of-messed-up/57164/3 "2022-03-15T08:40:04Z")

</div>

> [@josborn](#):
>
> time series chart and a tag history data source?

The first image I posted. This was as a reference, to show that the problem doesn't seem to lie with the tag history itself, but with how it's queried.  
So, I can use a time series chart or an XY chart to display data properly, but it's quite frustrating when there's the power chart that would be so convenient... I had to resort to making my own component, based on one of the two previously mentioned charts, dropdowns and scripts, to display data. That sucks.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [March 15, 2022, 5:41pm UTC](https://forum.inductiveautomation.com/t/tag-history-queries-are-kind-of-messed-up/57164/4 "2022-03-15T17:41:43Z")

</div>

> [@pascal.fragnoud](#):
>
> That sucks.

No argument here. You are far from the fist to run into this and come out disatisfied, but good news, they are working on it.

> [@\[FEATURE\] Increase usability of the Perspective Power Chart component](https://forum.inductiveautomation.com/t/feature-increase-usability-of-the-perspective-power-chart-component/51474/26):
>
> @kirsten.chambers, we just prioritized several power chart tickets for the upcoming development sprint. I also bumped the priority on the “As Stored” ticket based on your feedback.

---

<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:** [March 16, 2022, 8:36am UTC](https://forum.inductiveautomation.com/t/tag-history-queries-are-kind-of-messed-up/57164/5 "2022-03-16T08:36:51Z")

</div>

Yes that’s good news.  
But I’d still like to understand what’s going on with the `pointCount` and `periodic` queries… There must be something very weird happening. The second chart shows that quite clearly, the data just gets ‘flattened’ at some point by the aggregation or something, to a constant value, that has absolutely nothing to do with the real data that gets pulled from the historian…
