group-ratio

pebblestream:group-ratio("Last name", "First name", ... "Amount")

All rows with the same "Last name" and "First name" are put next to each other with their "Amount" values replaced by their "Amount" value divided by their group's summed "Amount" value

📘

When the group's sum is zero, all ratios are assigned the value of zero.

❗️

Important

Can't be used with the "group", "group-unique", or "group-sum" directives.

Example

Consider the worksheet Deposits

FirstLastDeposit
JohnJones20
AdamJones186
CathyAlbertson48794
JohnJones545
CathyAlbertson8777

Using the following directive:

pebblestream:from(Deposits)
pebblestream:group-ratio("Last", "First", "Deposit")

derives the worksheet Ratio Deposited

FirstLastDeposit
JohnJones0.03539823
JohnJones0.96460177
AdamJones1
CathyAlbertson0.847544771
CathyAlbertson0.152455229