# Exporting live tag values to Excel

**URL:** <https://forum.inductiveautomation.com/t/exporting-live-tag-values-to-excel/27647>\
**Category:** Ignition\
**Tags:** ignition79, python, scripting, database\
**Created:** [August 21, 2019, 9:05pm UTC](https://forum.inductiveautomation.com/t/exporting-live-tag-values-to-excel/27647 "2019-08-21T21:05:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul.ramesh](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@rahul.ramesh](https://forum.inductiveautomation.com/u/rahul.ramesh)\
**Post date:** [August 21, 2019, 9:05pm UTC](https://forum.inductiveautomation.com/t/exporting-live-tag-values-to-excel/27647/1 "2019-08-21T21:05:40Z")

</div>

Is there a way to export live tag values to excel and store them to view the RAW data? Basically I have a sensor which is reading data and calculating averages in the PLCs, I would like to analyse all the data coming through the PLC tag for experimental and analytic purposes. I have tried using easy chart to save the data but was not sure how to start and stop easy chart using a particular tag but not by time.  
Any help would be appreciated, Thank You in advance.

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [August 21, 2019, 9:14pm UTC](https://forum.inductiveautomation.com/t/exporting-live-tag-values-to-excel/27647/2 "2019-08-21T21:14:07Z")

</div>

Are you keeping a history of the tag? By logging to a database. If not you’ll have to set that up first. I would recommend transaction groups.

[https://docs.inductiveautomation.com/display/DOC80/Transaction+Group+Examples](https://docs.inductiveautomation.com/display/DOC80/Transaction+Group+Examples)  
[https://docs.inductiveautomation.com/display/DOC80/system.dataset.toCSV](https://docs.inductiveautomation.com/display/DOC80/system.dataset.toCSV)

something resembling the code below could be ran on a timer or off an event trigger.

```auto
results = system.db.runQuery("SELECT * FROM example1 LIMIT 100")
results = system.dataset.toDataSet(results)
csv = system.dataset.toCSV(dataset = results, showHeaders = True, forExport = False)
filePath = "C:\\output\\results.csv"
system.file.writeFile(filePath, csv)

```
