# Form a data table with data from DB

**URL:** <https://forum.inductiveautomation.com/t/form-a-data-table-with-data-from-db/108450>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [July 14, 2025, 10:22pm UTC](https://forum.inductiveautomation.com/t/form-a-data-table-with-data-from-db/108450 "2025-07-14T22:22:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pratik\_jain](https://avatars.discourse-cdn.com/v4/letter/p/97f17d/32.png) [@pratik\_jain](https://forum.inductiveautomation.com/u/pratik_jain)\
**Post date:** [July 14, 2025, 10:22pm UTC](https://forum.inductiveautomation.com/t/form-a-data-table-with-data-from-db/108450/1 "2025-07-14T22:22:50Z")

</div>

Hello all,

I am trying to get data for a tag at a certain step in the process. Is there any way we can do this without using SQL ? If not then how would I go about joining all the data between the partitions.

Problem statement:  
I want to find the weight scale value at current step = 53 for my process for last 6 months.

If someone can help me find a solution it would be great. I am not familiar with SQL.

Thank You in Advance !

---

<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:** [July 14, 2025, 11:10pm UTC](https://forum.inductiveautomation.com/t/form-a-data-table-with-data-from-db/108450/2 "2025-07-14T23:10:23Z")

</div>

> Is there any way we can do this without using SQL?

If the data is an SQL database then you need to use SQL.

> If not then how would I go about joining all the data between the partitions.

Do you mean Ignition's Historian partitions. Was the data saved with Ignition's Historian?

---

<div class="post-metadata">

**Author:** ![pratik\_jain](https://avatars.discourse-cdn.com/v4/letter/p/97f17d/32.png) [@pratik\_jain](https://forum.inductiveautomation.com/u/pratik_jain)\
**Post date:** [July 15, 2025, 2:51pm UTC](https://forum.inductiveautomation.com/t/form-a-data-table-with-data-from-db/108450/3 "2025-07-15T14:51:05Z")

</div>

Yes, data was saved using ignition’s historian

---

<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:** [July 15, 2025, 3:08pm UTC](https://forum.inductiveautomation.com/t/form-a-data-table-with-data-from-db/108450/4 "2025-07-15T15:08:48Z")

</div>

Then you retrieve the data using Ignition's [system.tag | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag) functions and, probably, [system.tag.queryTagHistory | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-queryTagHistory). These functions handle partitioning automatically.

---

<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:** [July 15, 2025, 3:27pm UTC](https://forum.inductiveautomation.com/t/form-a-data-table-with-data-from-db/108450/5 "2025-07-15T15:27:59Z")

</div>

I suggest that you learn how the history has been stored.

- Create a view with a table in it.
- Create a binding on the table's `data` property.
- Select "Tag History Binding".

Play around with this, having a look at the returned data displayed in the table.  
When you understand the returned data then you can start thinking about writing a script to get the data into the format you want.

---

<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:** [July 15, 2025, 3:42pm UTC](https://forum.inductiveautomation.com/t/form-a-data-table-with-data-from-db/108450/6 "2025-07-15T15:42:58Z")

</div>

> [@Transistor](#):
>
> Play around with this

Indeed.

And you will likely need to create a script that makes multiple scripted history queries. Something like:

- Gather all of the raw data for the trigger tag over the whole time period,
- Loop through that collecting the start,end timestamps for the inner time periods, then
- query for all of the tags of interest for each inner time period.
- Do something with all of the data...
