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 syntax

group-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.

❗️

Limitation

This directive cannot be paired with the group, group-unique, or group-ratio directives.

Example

Consider the worksheet Transactions

FirstLastTransfer
JohnJohns-60
AdamJones186
CathyAlbertson48794
JohnJones545
CathyAlbertson8777

Apply the following directive declaration:

pebblestream:from(Transactions)
pebblestream:group-sum("Last", "First", "Transfer")

to obtain the Totals worksheet.

FirstLastTransfer
JohnJones485
AdamJones186
CathyAlbertson57571

Did this page help you?