# Reporting - Tag History Query Data - how to convert feet to inches

**URL:** <https://forum.inductiveautomation.com/t/reporting-tag-history-query-data-how-to-convert-feet-to-inches/85497>\
**Category:** Ignition\
**Tags:** perspective, reporting\
**Created:** [February 9, 2024, 7:10pm UTC](https://forum.inductiveautomation.com/t/reporting-tag-history-query-data-how-to-convert-feet-to-inches/85497 "2024-02-09T19:10:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce\_Altmann](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Bruce\_Altmann](https://forum.inductiveautomation.com/u/Bruce_Altmann)\
**Post date:** [February 9, 2024, 7:10pm UTC](https://forum.inductiveautomation.com/t/reporting-tag-history-query-data-how-to-convert-feet-to-inches/85497/1 "2024-02-09T19:10:38Z")

</div>

Just trying to export from scada data daily for another platform.  
(coding up another static table Report)

Just need to convert a few tank level from  
feet  
to  
inches  
(the perspective view does this by design for the web user, but I don't see a reporting option - other that python code - and a history query w python code takes a while over a basic tag history data source)

Checked the Docs  
Checked the forum

Any and all options are appreciated.........

---

<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:** [February 9, 2024, 7:19pm UTC](https://forum.inductiveautomation.com/t/reporting-tag-history-query-data-how-to-convert-feet-to-inches/85497/2 "2024-02-09T19:19:04Z")

</div>

Modify the query.

```auto
SELECT
    Timestamp,
    Level * 12 AS LevelInches
FROM ...

```

---

<div class="post-metadata">

**Author:** ![Bruce\_Altmann](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Bruce\_Altmann](https://forum.inductiveautomation.com/u/Bruce_Altmann)\
**Post date:** [February 9, 2024, 8:20pm UTC](https://forum.inductiveautomation.com/t/reporting-tag-history-query-data-how-to-convert-feet-to-inches/85497/3 "2024-02-09T20:20:42Z")

</div>

Where in the normal report builder - tag history data source - can I modify the SQL?

Don't see that.

I assume you mean for a report - data source - sql query (which means parsing the history sql tables)

---

<div class="post-metadata">

**Author:** ![Bruce\_Altmann](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Bruce\_Altmann](https://forum.inductiveautomation.com/u/Bruce_Altmann)\
**Post date:** [February 9, 2024, 8:21pm UTC](https://forum.inductiveautomation.com/t/reporting-tag-history-query-data-how-to-convert-feet-to-inches/85497/4 "2024-02-09T20:21:01Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/e/ce9c0a3a39f05d70235cf46e1ec8766d8e0f7e9a.png)

---

<div class="post-metadata">

**Author:** ![Bruce\_Altmann](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Bruce\_Altmann](https://forum.inductiveautomation.com/u/Bruce_Altmann)\
**Post date:** [February 9, 2024, 8:37pm UTC](https://forum.inductiveautomation.com/t/reporting-tag-history-query-data-how-to-convert-feet-to-inches/85497/5 "2024-02-09T20:37:07Z")

</div>

There it is  
Reporting  
Tag historian query  
after the data source alias is defined  
in the Design Tab  
inside the @\_@  
@tag\_history.bulldog compressor station tank 1 oil \* 12@

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 9, 2024, 8:38pm UTC](https://forum.inductiveautomation.com/t/reporting-tag-history-query-data-how-to-convert-feet-to-inches/85497/6 "2024-02-09T20:38:07Z")

</div>

No, you can't modify the SQL for a historian query. You will need to reprocess that result with a script datasource.

Or, if reporting in tabular form, just use a formula in the cell that normally would report the feet.

{ You will probably want to omit the `tag_history.` prefix from the column reference in the cell. }

---

<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:** [February 9, 2024, 8:42pm UTC](https://forum.inductiveautomation.com/t/reporting-tag-history-query-data-how-to-convert-feet-to-inches/85497/7 "2024-02-09T20:42:45Z")

</div>

There's a demonstration about 35 s in on the IU video.

> **[Key Calculations Video at Inductive University](https://inductiveuniversity.com/videos/key-calculations/8.1)**
>
> Learn how to run math calculations on data keys in the Design panel. Explore using them in a table.

---

<div class="post-metadata">

**Author:** ![Bruce\_Altmann](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Bruce\_Altmann](https://forum.inductiveautomation.com/u/Bruce_Altmann)\
**Post date:** [February 9, 2024, 10:06pm UTC](https://forum.inductiveautomation.com/t/reporting-tag-history-query-data-how-to-convert-feet-to-inches/85497/8 "2024-02-09T22:06:00Z")

</div>

Yep (you found it)

That is what I was looking for.

(wish there was a quick mention in the Docs - yes you can do data source key calc - go look here.......)
