# Forcing rows in queryTagHistory

**URL:** <https://forum.inductiveautomation.com/t/forcing-rows-in-querytaghistory/27985>\
**Category:** Ignition\
**Created:** [September 3, 2019, 8:10pm UTC](https://forum.inductiveautomation.com/t/forcing-rows-in-querytaghistory/27985 "2019-09-03T20:10:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfryar](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jfryar](https://forum.inductiveautomation.com/u/jfryar)\
**Post date:** [September 3, 2019, 8:10pm UTC](https://forum.inductiveautomation.com/t/forcing-rows-in-querytaghistory/27985/1 "2019-09-03T20:10:09Z")

</div>

Is there a way to force queryTagHistory to put rows into a dataset even when there is not data during the selected time period? For my script to calculate accurately I can’t have the dataset skipping days. Even if there isn’t any data. I’d rather it return 0’s than to simply omit those days.

See attached for example.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/12dcf03955f58eec9ad0ac89026afa83ed086c1e.png)

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [September 3, 2019, 8:35pm UTC](https://forum.inductiveautomation.com/t/forcing-rows-in-querytaghistory/27985/2 "2019-09-03T20:35:23Z")

</div>

I noticed that you are basically getting values once a day at the same time every day, if that’s the case, you may be able to get what you want by setting the `intervalHours` argument to 24. That should return a new row for every 24 hour time period. That should work as long as you aren’t also supplying a `returnSize` argument. You may also need to set the `noInterpolation` argument to True.

---

<div class="post-metadata">

**Author:** ![jfryar](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jfryar](https://forum.inductiveautomation.com/u/jfryar)\
**Post date:** [September 3, 2019, 8:51pm UTC](https://forum.inductiveautomation.com/t/forcing-rows-in-querytaghistory/27985/3 "2019-09-03T20:51:33Z")

</div>

I am not supplying a returnSize argument. It appears that setting the noInterpolation argument to False forces it to insert the data for the missing rows. It also doesn’t appear to affect the values on the rows we have data for.

I wonder if interpolation would have a more drastic affect if we had intermittently missing data in historian?

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [September 3, 2019, 9:38pm UTC](https://forum.inductiveautomation.com/t/forcing-rows-in-querytaghistory/27985/4 "2019-09-03T21:38:58Z")

</div>

It looks like you are right. There doesn’t seem to be an easy way to do this with what we have provided. Like you said, with noInterpolation set to False you will get values where there probably wasn’t any values and that’s not a great solution. You may just have to use our system.dataset script functions to insert those rows in manually where there are gaps.

---

<div class="post-metadata">

**Author:** ![jfryar](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jfryar](https://forum.inductiveautomation.com/u/jfryar)\
**Post date:** [September 3, 2019, 9:59pm UTC](https://forum.inductiveautomation.com/t/forcing-rows-in-querytaghistory/27985/5 "2019-09-03T21:59:46Z")

</div>

I meant to say that setting interpolation to False seems to add the rows. I’m just a little concerned that interpolation may cause an ever widening margin of error.

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [September 3, 2019, 10:15pm UTC](https://forum.inductiveautomation.com/t/forcing-rows-in-querytaghistory/27985/6 "2019-09-03T22:15:18Z")

</div>

Yeah exactly, shouldn’t have to rely on that especially if you don’t want any margin of error. It may be worthwhile to not go that route and try to find a scripting solution.
