group-sum
This directive determines grouped rows by common column values. It then provides the sum of the specified numeric column for each group.
pebblestream:group-sum("Last name", "First name", ... "Amount")
A note on group-sum's syntaxgroup-sum will always sum by the last parameter in the parameter list, and group by all the preceding parameters. So in the above example "Amount" is the column to be summed, whereas "Last name", "First Name", and all other preceding parameters are used to group.
LimitationThis directive cannot be paired with the group, group-unique, or group-ratio directives.
Consider the worksheet Transactions
| First | Last | Transfer |
|---|---|---|
| John | Johns | -60 |
| Adam | Jones | 186 |
| Cathy | Albertson | 48794 |
| John | Jones | 545 |
| Cathy | Albertson | 8777 |
Apply the following directive declaration:
pebblestream:from(Transactions)
pebblestream:group-sum("Last", "First", "Transfer")to obtain the Totals worksheet.
| First | Last | Transfer |
|---|---|---|
| John | Jones | 485 |
| Adam | Jones | 186 |
| Cathy | Albertson | 57571 |
Updated 3 days ago
