Hi,

How to sum values on same page from a Widget, by column?

Best

Hi anefta.

To sum Total_Price, add a new summary table widget for PRODUCT_ORDERS without selecting any columns to group by. This should give you a summary table with a single column counting the number of records in the source table.

Then, you can add a new formula column to the summary table and use the following formula to get the total sum of all values under Total_Price:

```
SUM($group.Total_Price)
```

Here, $group is a special object that holds all the records that were summarized in that row. In this case, it holds all of them since we aren’t grouping by anything and only have a single row in our summary table. We then simply sum over all of the rows using the SUM function.

There’s a helpful guide here with a video that demonstrates additional ways you can calculate totals using summary formulas: Summary Tables Guide - Grist Help Center

George

2 Likes

If I’m not mistaken, the new summary table should automatically have a column with `SUM($group.Total_Price)`

, so just creating the summary table should be enough.

1 Like