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:
sum({../Table_1.props.data},"Passed")
Here is the dataset I am trying to sum:
I have done this with mean on similar tables before and no issues. Im sure I am missing something simple. Can you all help?
I do have a transform on this table for the coloring, could that be it?
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
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.
2 Likes