# Sum columns in a table issue

**URL:** <https://forum.inductiveautomation.com/t/sum-columns-in-a-table-issue/103533>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [March 11, 2025, 6:17pm UTC](https://forum.inductiveautomation.com/t/sum-columns-in-a-table-issue/103533 "2025-03-11T18:17:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [March 11, 2025, 6:17pm UTC](https://forum.inductiveautomation.com/t/sum-columns-in-a-table-issue/103533/1 "2025-03-11T18:17:07Z")

</div>

I am getting an error when I sum a column in a table: sum should only be called with one array argument.

Here is the expression:

```python
sum({../Table_1.props.data},"Passed")

```

Here is the dataset I am trying to sum:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/2/f26125ee85960995e3855731a8899bb9c67508e4.png)  
I have done this with mean on similar tables before and no issues. Im sure I am missing something simple. Can you all help?

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [March 11, 2025, 6:20pm UTC](https://forum.inductiveautomation.com/t/sum-columns-in-a-table-issue/103533/2 "2025-03-11T18:20:43Z")

</div>

I do have a transform on this table for the coloring, could that be it?

```python
	output_json = []
	
	style_yellow = {"backgroundColor": "#FFFF47"}
	style_green = {"backgroundColor": "#47FF47"}
	style_orange = {"backgroundColor": "#FFAC47"}
		
	for row in range(value.getRowCount()):
		row_object = {}
		row_value = {}
		row_style = {}
		for col in range(value.getColumnCount()):    
			row_value[value.getColumnName(col)] = value.getValueAt(row, col)
			row_object['value'] = row_value
			
		#if value.getValueAt(row, 3) == 'Complete':
		#	row_style = style_grey
			if value.getValueAt(row, 4) > 75 and value.getValueAt(row, 4) <= 85:
				row_style = style_yellow
			elif value.getValueAt(row, 4) <= 84:
				row_style = style_orange
			row_object['style'] = row_style
		output_json.append(row_object)
	return output_json

```

---

<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:** [March 11, 2025, 6:23pm UTC](https://forum.inductiveautomation.com/t/sum-columns-in-a-table-issue/103533/3 "2025-03-11T18:23:23Z")

</div>

Yes, that syntax for `sum()` requires a dataset. Styling rows and individual cells in a table requires JSON, which is what your transform must be delivering.

Move the query to a custom property and keep that in dataset format. On the table's `props.data`, use a property binding to the dataset and then transform.
