# Creating a Power table of realtime values

**URL:** <https://forum.inductiveautomation.com/t/creating-a-power-table-of-realtime-values/69071>\
**Category:** Ignition\
**Created:** [January 27, 2023, 2:15am UTC](https://forum.inductiveautomation.com/t/creating-a-power-table-of-realtime-values/69071 "2023-01-27T02:15:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cole.sharrah](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@cole.sharrah](https://forum.inductiveautomation.com/u/cole.sharrah)\
**Post date:** [January 27, 2023, 2:15am UTC](https://forum.inductiveautomation.com/t/creating-a-power-table-of-realtime-values/69071/1 "2023-01-27T02:15:24Z")

</div>

My goal is to improve the way the table is created. This table's purpose is to show Realtime values.  
This is the shared script creating the table.  
[Shared Script Systems Overview.txt](https://forum.inductiveautomation.com/uploads/short-url/wMkehstCx9rEYpnGdl4MfdQFCEN.txt) (30.7 KB)

This is the binding on the data property of the power table.  
[Systems Overview Data Binding.txt](https://forum.inductiveautomation.com/uploads/short-url/t9h2dXK3IlmfFgEMCziO9o8z7yQ.txt) (1.2 KB)

Here is part of the table. It has 28 columns and 45 rows. The rows will get larger in the future.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/0/2037864bfb113a38922c4b2e407c030f5080975b.png)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 27, 2023, 3:02am UTC](https://forum.inductiveautomation.com/t/creating-a-power-table-of-realtime-values/69071/2 "2023-01-27T03:02:13Z")

</div>

I'm not sure what you're asking for here, but more than 50 lines of code could be eliminated from your script with the following refactor:

```auto
def combineDatasets(DS1, DS2, DS3, DS4, DS5, DS6, DS7, DS8, DS9, DS10, DS11, DS12, DS13, DS14, DS15, DS16, DS17, DS18, DS19, DS20, DS21, DS22, DS23, DS24, DS25, DS26, DS27, DS28, DS29, DS30, DS31, DS32, DS33, DS34, DS35, DS36, DS37, DS38, DS39, DS40, DS41, DS42, DS43, DS44, DS45):
	headers = ["t_stamp","Well","GPU","<HTML><center>Flow Rate<BR>-MMCFD-","<HTML><center>Total Gas TDY<BR>-MMCF-","<HTML><center>Total Gas YDY<BR>-MMCF-","<HTML><center>Tubing<BR>-PSI-","<HTML><center>Casing<BR>-PSI-","<HTML><center>9 5/8<BR>-PSI-","<HTML><center>13 3/8<BR>-PSI-","<HTML><center>Surface Casing<BR>-PSI-","<HTML><center>Sand Trap<BR>-PSI-","<HTML><center>Separator<BR>-PSI-","<HTML><center>WH Static<BR>-PSI-","<HTML><center>WH DP<BR>-PSI-","<HTML><center>Midstream<BR>-PSI-","<HTML><center>Delivery Static1<BR>-PSI-","<HTML><center>Delivery Static2<BR>-PSI-","<HTML><center>Filter Sep<BR>-PSI-","<HTML><center>Filter Sep DP<BR>-PSI-","<HTML><center>Dew Point<BR>-LB/H<sub>2</sub>O-","Choke","<HTML><center>Brine Flow<BR>-BBLD-","<HTML><center>Today Water<BR>-BBL-","<HTML><center>Yest. Water<BR>-BBL-","<HTML><center>Tank 1<BR>-BBL- ","<HTML><center>Tank 2<BR>-BBL- ","<HTML><center>Tank 3<BR>-BBL- ","<HTML><center>Tank 4<BR>-BBL- "]
	data = []
	for i in range(46)
		dataset = DS + str(i) 
		row = []
		for column in range(29)
			row.append(eval(dataset).getValueAt(0,column))
		data.append(row)
	return system.dataset.toDataSet(headers,data)

```

---

<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:** [January 27, 2023, 3:06am UTC](https://forum.inductiveautomation.com/t/creating-a-power-table-of-realtime-values/69071/3 "2023-01-27T03:06:10Z")

</div>

Cross-posted. See my reply over here:

> [@Inserting data from a Power table into SQL database table](https://forum.inductiveautomation.com/t/inserting-data-from-a-power-table-into-sql-database-table/69070/5):
>
> Ew! All this to display the most recent values of tags? Are the tags arranged in folders with identical inner tag names? (Or UDTs, which have the same effect?) If so, a template that displays one row of tag values, using indirect binding, arranged in a template repeater, would be far more performant. With no SQL at all. (The template repeater would be set to dataset mode, and that dataset's one column would have the necessary tagpath strings.)

{Cole, please don't repost. It is against this [forum's rules](https://forum.inductiveautomation.com/faq). }

---

<div class="post-metadata">

**Author:** ![cole.sharrah](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@cole.sharrah](https://forum.inductiveautomation.com/u/cole.sharrah)\
**Post date:** [January 27, 2023, 6:25am UTC](https://forum.inductiveautomation.com/t/creating-a-power-table-of-realtime-values/69071/4 "2023-01-27T06:25:42Z")

</div>

Thank you! This is what I was looking for, I will give it a try.

---

<div class="post-metadata">

**Author:** ![cole.sharrah](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@cole.sharrah](https://forum.inductiveautomation.com/u/cole.sharrah)\
**Post date:** [January 27, 2023, 6:30am UTC](https://forum.inductiveautomation.com/t/creating-a-power-table-of-realtime-values/69071/5 "2023-01-27T06:30:43Z")

</div>

Yes, @pturmel this is a solution to the issue on this topic.  
It is not related to the other topic, where it was posted.  
Two separate issues/topics.  
Creating the table and then moving the table data into a SQL table.
