# Working with dataset in expression

**URL:** <https://forum.inductiveautomation.com/t/working-with-dataset-in-expression/6719>\
**Category:** Ignition\
**Created:** [June 17, 2013, 11:34am UTC](https://forum.inductiveautomation.com/t/working-with-dataset-in-expression/6719 "2013-06-17T11:34:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinmarchand](https://avatars.discourse-cdn.com/v4/letter/k/439d5e/32.png) [@kevinmarchand](https://forum.inductiveautomation.com/u/kevinmarchand)\
**Post date:** [June 17, 2013, 11:34am UTC](https://forum.inductiveautomation.com/t/working-with-dataset-in-expression/6719/1 "2013-06-17T11:34:42Z")

</div>

Hi,

```
 I have a table with 2 column : Length and reason.
 I would like to show the total length in a LED display.

 How can I loop trough the row and sum all the length?

```

nota : the table data is not link to a sql table it is feed manually by the operator.

---

<div class="post-metadata">

**Author:** ![CPowell](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@CPowell](https://forum.inductiveautomation.com/u/CPowell)\
**Post date:** [June 17, 2013, 3:12pm UTC](https://forum.inductiveautomation.com/t/working-with-dataset-in-expression/6719/2 "2013-06-17T15:12:52Z")

</div>

Yes, you can.

```auto
#Get the dataset
data = event.source.parent.getComponent('Table').data
totallength = 0

#The length from each row
for row in range(data.rowCount):
	length = data.getValueAt(row,"length")
	totallength += length
	
#Push the total length to a label
event.source.parent.getComponent('Label').text = str(totallength)

```

I used a button, then push this information to a label on the screen.

Cheers,  
Chris
