# Edge Historian Scripting not working?

**URL:** <https://forum.inductiveautomation.com/t/edge-historian-scripting-not-working/100445>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 4, 2025, 5:12am UTC](https://forum.inductiveautomation.com/t/edge-historian-scripting-not-working/100445 "2025-01-04T05:12:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Koen](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@Koen](https://forum.inductiveautomation.com/u/Koen)\
**Post date:** [January 4, 2025, 5:12am UTC](https://forum.inductiveautomation.com/t/edge-historian-scripting-not-working/100445/1 "2025-01-04T05:12:39Z")

</div>

Hi,

I can pull a tag history from the edge historian using script (system.tag.queryTagHistory()). This works fine in the Script Console but I can't seem to get a value (other than zero) when I run the same script in either a gateway scoped script, or even in a binding in Perspective.

Is there some limitation on using system.tag.queryTagHistory() in Edge?

Sample code that works in Designer but only gives zero else where:

```python
	path = "[Edge Historian]rio/crc_t_1"
	start_date = system.date.parse("29/12/2024 0:00", "dd/MM/yyyy hh:mm")
	end_date = system.date.parse("1/1/2025 0:00", "dd/MM/yyyy hh:mm")
	v_avg = system.tag.queryTagHistory(paths=[path], startDate=start_date, endDate=end_date, aggregationMode="Average", returnSize=1)
	v_avg = v_avg.getValueAt(0,1)

```

A print(v\_avg) in designer gives me 51.212...... where as in gateway event I get 0 ??

Thanks for your insights.

---

<div class="post-metadata">

**Author:** ![Koen](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@Koen](https://forum.inductiveautomation.com/u/Koen)\
**Post date:** [January 4, 2025, 7:35am UTC](https://forum.inductiveautomation.com/t/edge-historian-scripting-not-working/100445/2 "2025-01-04T07:35:32Z")

</div>

Sorry all,

I figured it out. The historical path should be:

`[Edge Historian/edge]rio/crc_t_1`

the "/edge" was crucial here - eventhout in the script console it didn't throw errors.
