# \[SOLVED\] queryTagCalculations returning BasicStreamingDataset

**URL:** <https://forum.inductiveautomation.com/t/solved-querytagcalculations-returning-basicstreamingdataset/14257>\
**Category:** Ignition\
**Created:** [May 10, 2017, 8:19pm UTC](https://forum.inductiveautomation.com/t/solved-querytagcalculations-returning-basicstreamingdataset/14257 "2017-05-10T20:19:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacslade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacslade/32/3587_2.png) [@zacslade](https://forum.inductiveautomation.com/u/zacslade)\
**Post date:** [May 10, 2017, 8:19pm UTC](https://forum.inductiveautomation.com/t/solved-querytagcalculations-returning-basicstreamingdataset/14257/1 "2017-05-10T20:19:27Z")

</div>

Hi all,

I have the following function in a script in the datasources for a report

> def getMinMaxInverterData(date0,date1):
> 
> ```
> numInverters = system.tag.read("Calculations/Device Quantities/PCS").value
>   
> tagPaths = []
> inverterList = []
>   
> for i in range(1,numInverters + 1):
> tagPaths.append("PCSs/PCS " + str(i) + "/Inverter/AC Energy Total/Scaled Value")
> inverterList.append("PCS " + str(i) + " Inverter")
>   
> calculation = ["Minimum", "Maximum"]
> inverterData = system.tag.queryTagCalculations(
> paths = tagPaths, 
> aliases = inverterList, 
> calculations = calculation, 
> startDate = date0, 
> endDate = date1
> )
> return inverterData
> 
> ```

The type of the returned value is "class com.inductiveautomation.ignition.gateway.datasource.BasicStreamingDataset".  
When I try to access a value in the dataset in order to do further calculations on it, the value is NoneType.

Performing the same calculations in the script console returns a regular dataset, and I get no errors.

Has anyone else encountered this type of issue before?

Thanks,

---

<div class="post-metadata">

**Author:** ![zacslade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacslade/32/3587_2.png) [@zacslade](https://forum.inductiveautomation.com/u/zacslade)\
**Post date:** [May 11, 2017, 12:10am UTC](https://forum.inductiveautomation.com/t/solved-querytagcalculations-returning-basicstreamingdataset/14257/2 "2017-05-11T00:10:33Z")

</div>

Removing the assignment to “aliases” seems to have solved the problem. However, now the tagpath column just has “Scaled Value” over and over. This might be an ignition bug, unless someone can point out to me how/where I misspelled something.

EDIT: Removing the assignment to aliases got rid of the error popup, but my return data is still bad. Haven’t solved this one yet.

---

<div class="post-metadata">

**Author:** ![adam.morales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/adam.morales/32/3405_2.png) [@adam.morales](https://forum.inductiveautomation.com/u/adam.morales)\
**Post date:** [May 11, 2017, 11:09pm UTC](https://forum.inductiveautomation.com/t/solved-querytagcalculations-returning-basicstreamingdataset/14257/3 "2017-05-11T23:09:06Z")

</div>

What is the rowCount of the dataset that you get in the reporting script? You may need use the full tag paths, and include the tag provider.

---

<div class="post-metadata">

**Author:** ![zacslade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacslade/32/3587_2.png) [@zacslade](https://forum.inductiveautomation.com/u/zacslade)\
**Post date:** [May 19, 2017, 8:04pm UTC](https://forum.inductiveautomation.com/t/solved-querytagcalculations-returning-basicstreamingdataset/14257/4 "2017-05-19T20:04:02Z")

</div>

Sorry for the late reply. The rowcount for the returned dataset was correct. The solution to this, in the end, was to use full tagpaths (including the provider name).

On a related note, nearby my report viewer I had a button which ran a nearly identical script , but used the data to produce a csv instead. After the most recent java/ignition updates, I for some reason had to change the provider from “[default]” to “[~]” in every place where I called queryTagCalculations. In the same script, I had some calls to queryTagHistory, and those only work when the provider is “[default]”; they do not work with “[~]”.

Not sure if this is a bug or a misunderstanding on my part.

---

<div class="post-metadata">

**Author:** ![zackscriven](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zackscriven/32/7213_2.png) [@zackscriven](https://forum.inductiveautomation.com/u/zackscriven)\
**Post date:** [May 24, 2017, 11:31pm UTC](https://forum.inductiveautomation.com/t/solved-querytagcalculations-returning-basicstreamingdataset/14257/5 "2017-05-24T23:31:11Z")

</div>

We should start using tag provider names across all of our applications.

When doing queries against the tag historian keep in mind the correct format is [historyProviderName]path/to/tag

Using [~] is relative to the Tag provider of the Tag that is being bound (root node). I believe this works for realtime or historical bindings. See the update below

In 7.9.2 they changed the way that tag history paths are parsed:

SQLTags Fixed Inconsistencies with path interpretation causing confusion with tag history and issues with remote historian providers.

---

<div class="post-metadata">

**Author:** ![adam.morales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/adam.morales/32/3405_2.png) [@adam.morales](https://forum.inductiveautomation.com/u/adam.morales)\
**Post date:** [May 25, 2017, 5:26pm UTC](https://forum.inductiveautomation.com/t/solved-querytagcalculations-returning-basicstreamingdataset/14257/6 "2017-05-25T17:26:39Z")

</div>

This is related to a known issue that has been fixed for version 7.9.3
