# Convert historical status (string) data to integers

**URL:** <https://forum.inductiveautomation.com/t/convert-historical-status-string-data-to-integers/98473>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 11, 2024, 5:19pm UTC](https://forum.inductiveautomation.com/t/convert-historical-status-string-data-to-integers/98473 "2024-11-11T17:19:38Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [November 11, 2024, 5:54pm UTC](https://forum.inductiveautomation.com/t/convert-historical-status-string-data-to-integers/98473/3 "2024-11-11T17:54:55Z")

</div>

You could do it in a transform, but there is an efficiency hit:

```python
mapDict = {'Q' : 4,
           'R' : 1,
		   'S' : 2
		  }

headers = list(value.columnNames)

# dict.get() can return a default value if the key is not found in the dictionary.
data = [[value.getValueAt(row,0), mapDict.get(value.getValueAt(row,1), 0)] for row in xrange(value.rowCount)]

return system.dataset.toDataSet(headers, data)

```

But, you may want to consider putting the raw data in a custom prop and use @pturmel's [Integration Toolkit module](https://forum.inductiveautomation.com/t/automation-professionals-integration-toolkit-module/74934) to do the transform as an expression. Much more performant.

---

_[View the full topic](https://forum.inductiveautomation.com/t/convert-historical-status-string-data-to-integers/98473)._
