Reply To: Group By and aggregate function

#7387
Bill Finzer
Keymaster

Hello MdC and welcome to the CODAP community,

While it is possible to use the Transformers plugin to make calculations on groups, if you’re willing to restructure the data a bit (a strength of CODAP), there is an elegant, builtin method.

  1. Drag the grouping attribute (Diet) all the way to the left in the case table. This will produce a new “parent” table, name Diets, with three rows, one for each value of Diet.
  2. Create a new attribute for the Diets table by clicking on the “plus” icon. Give it a meaningful name, perhaps AvgMass.
  3. Click on the name of the new attribute and choose Edit Formula.
  4. A reasonable formula in this situation might be
    mean(Mass).

Please see this CODAP help page for more details.

Bill