# system.tag.queryTagHistory not updating the data and bring duplicate or same value for last result

**URL:** <https://forum.inductiveautomation.com/t/system-tag-querytaghistory-not-updating-the-data-and-bring-duplicate-or-same-value-for-last-result/60434>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [June 7, 2022, 1:38am UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-not-updating-the-data-and-bring-duplicate-or-same-value-for-last-result/60434 "2022-06-07T01:38:46Z")\
**Posts on this page:** 1\
**Showing post:** 12

<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:** [June 8, 2022, 1:10pm UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-not-updating-the-data-and-bring-duplicate-or-same-value-for-last-result/60434/12 "2022-06-08T13:10:17Z")

</div>

Not certain if this is contributing to what you are seeing or not, but it is definitely not correct.

1. `'true'` is not the boolean value `True`.
2. You're using both `returnSize` and `intervalMinutes`, yes there are 96 - 15min intervals in 24 hours, but you only need to use one of these. Personally I think intervalMinutes is more readable
3. Your `columnName` list has to be a 1-1 match with the tagPaths, since `'Timestamp'` isn't one of the tagPaths that you are providing then it shouldn't be included in the list.

Your definition of the columnName list should look like:

```python
columnName = ['Well 4A m3','Well 9 m3','Well 12 m3','Well 15 m3','Well 17 m3']

```

Your call to `system.tag.queryTagHistory()` should look like:

```python
dataSet = system.tag.queryTagHistory(paths=TagPaths, startDate=startTime, endDate=endTime, aggregationMode=LastValue, returnFormat='Wide', ignoreBadQuality = True, columnNames=columnName, intervalMinutes =15 ) 

```

As an aside, if you want to print a dataset and see the contents, then you can use this helper script provided by @JordanCClark . It is quite handy.

> [@View Dataset from script console](https://forum.inductiveautomation.com/t/view-dataset-from-script-console/36704/4):
>
> Sorry, I'm on vacation, but family is napping, so I get to play. Yes, this is how I relax. Don't judge. EDIT: Added option for printing from Perspective. Sorry, not quite ready for prime time. roll_eyes def printDataSet(datasetIn): from itertools import izip import ast if 'PropertyTreeScriptWrapper$ArrayWrapper' in str(type(datasetIn)): headers = datasetIn[0].keys() data = [] for row in datasetIn: data.append([item.value for item in row.values()]) datasetIn = system.dataset…

---

_[View the full topic](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-not-updating-the-data-and-bring-duplicate-or-same-value-for-last-result/60434)._
