# Transform a Column

**URL:** <https://forum.inductiveautomation.com/t/transform-a-column/96202>\
**Category:** Ignition\
**Tags:** database, perspective\
**Created:** [September 19, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/transform-a-column/96202 "2024-09-19T20:01:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyler\_French](https://avatars.discourse-cdn.com/v4/letter/t/8797f3/32.png) [@Tyler\_French](https://forum.inductiveautomation.com/u/Tyler_French)\
**Post date:** [September 19, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/transform-a-column/96202/1 "2024-09-19T20:01:43Z")

</div>

Is there an easy way to transform a single column's value using a script?

I am rather new to this and looking for a way to transform the minutes remaining in an order to hours, so I just want to divide the returned value by 60 but I am not sure how to accomplish this for a column when the data is mapped to a dataset.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [September 19, 2024, 8:05pm UTC](https://forum.inductiveautomation.com/t/transform-a-column/96202/2 "2024-09-19T20:05:38Z")

</div>

Can you do it in the query that's feeding the database?

```python
SELECT
    ....,
    MinRemaining,
    FORMAT(MinRemaining / 60, 2) AS Hours
FROM
    ....

```

You can then display either column or both.

* * *

Note that in tables and SQL the phrase "transform a column" usually suggests converting a 1 column × n rows dataset into an n column × 1 row dataset. That's not what you're trying to do.

---

<div class="post-metadata">

**Author:** ![Tyler\_French](https://avatars.discourse-cdn.com/v4/letter/t/8797f3/32.png) [@Tyler\_French](https://forum.inductiveautomation.com/u/Tyler_French)\
**Post date:** [September 19, 2024, 8:07pm UTC](https://forum.inductiveautomation.com/t/transform-a-column/96202/3 "2024-09-19T20:07:29Z")

</div>

I don't really have access to the DB side of it and was looking for something specific to this component since the value is used and converted in other places like a label on other views.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [September 19, 2024, 8:09pm UTC](https://forum.inductiveautomation.com/t/transform-a-column/96202/4 "2024-09-19T20:09:40Z")

</div>

If you have rights to Ignition Designer then you have rights to the SQL queries (unless they're stored procedures in the database - but then you can still create your own queries). Have a look at the binding on the table's `PROPS.data`.
