# system.tag.queryTagHistory - gives uncertain initial value error

**URL:** <https://forum.inductiveautomation.com/t/system-tag-querytaghistory-gives-uncertain-initial-value-error/62192>\
**Category:** Ignition\
**Created:** [July 22, 2022, 2:10am UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-gives-uncertain-initial-value-error/62192 "2022-07-22T02:10:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ravi\_Iyer](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@Ravi\_Iyer](https://forum.inductiveautomation.com/u/Ravi_Iyer)\
**Post date:** [July 22, 2022, 2:10am UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-gives-uncertain-initial-value-error/62192/1 "2022-07-22T02:10:58Z")

</div>

Hi  
I am trying to access historical value of a tag (value about a minute ago)  
(and subtract it from value now, to get the difference).  
I am getting error ‘uncertain initial value’.  
Here is my tag editor - script.

* * *

endTime = system.date.now()  
startTime = system.date.addMinutes(endTime, -1)  
paths = [‘[default]History/building\_h/Boiler\_Gas\_Flow\_Accum’]  
dataSet = system.tag.queryTagHistory(paths = paths, startDate = startTime, endDate = endTime, returnSize = 1, aggregationMode = “LastValue”, returnFormat = “Wide”)

* * *

May be my paths is not in correct syntax, I am unable to refer to an example of the correct path…  
If someone has done anything similar to this, please let me know.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [July 22, 2022, 6:20am UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-gives-uncertain-initial-value-error/62192/2 "2022-07-22T06:20:47Z")

</div>

`paths = paths` seems risky. Try changing the variable name to some non-keyword.

Tip: select a block of code and press the \</\> button to format it. It will preserve indentation and do some syntax highlighting for you.

---

<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:** [July 22, 2022, 10:22am UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-gives-uncertain-initial-value-error/62192/3 "2022-07-22T10:22:51Z")

</div>

This is not an issue with python. You can safely reuse the kwarg name for the actual variable.

---

<div class="post-metadata">

**Author:** ![wbaker](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wbaker/32/85315_2.png) [@wbaker](https://forum.inductiveautomation.com/u/wbaker)\
**Post date:** [July 22, 2022, 10:28am UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-gives-uncertain-initial-value-error/62192/4 "2022-07-22T10:28:39Z")

</div>

Try setting your tag history config sample mode to discrete and see if your results are better.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 22, 2022, 12:16pm UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-gives-uncertain-initial-value-error/62192/5 "2022-07-22T12:16:07Z")

</div>

Did you try setting the **includeBoundingValues** flag to True?
