Calculate column values from Table

I’m trying to create a Display Label with a calculated value from a specific Table column that is populated based on an SQL query. The query uses a where clause based on a calendar, so anyone can select a date on the calendar to populate the table. I’d like to totalize the values of one column and display this on screen. One factor to consider is that the number of rows in the column can change from day to day.

Can anyone help with a possible solution?

below is the SQL query I’m using to populate the table:

“SELECT make, start_time, t_stamp, type, vat, temp_avg, silo, weight, bf_sp, bf_avg, pf_sp, pf_avg, cream_total, cream_add
FROM cheesemake
WHERE (start_time != “”) AND (start_time>’{Root Container.CalendarMinus2Hrs.date}’) AND (start_time<’{Root Container.CalendarPlus16Hrs.date}’)”

To sum all values in a column you can use the following expression where the first argument is the dataset and the second the column name.

sum({Table.props.data},“ColumnName”)

1 Like

Perfect, thank you. I found this under Aggregates group, I was looking under the Math group. I appreciate the very quick response.

1 Like

Hello.

For my numeric label, I am using below expression.

sum({Summary_Report.Table.data},“GRS Lit”)

My table are bind to a few different dataset tag.
So below is is my first dataset.

image

And once I clear my dataset, seems like the value still not updated. It still holding the previous value

image

Wondering why it does not show 0 when I already removed the value in Row 1 and 2 ?

Use the Fallback Value on your query binding. If no value is present in the query, this will force the value you’ve entered.

Hello p_hanson.
I am using indirect tag binding for my table.
May I know how can I do that ?