Working with dataset in expression

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.

Yes, you can.

#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