Ash Calculation on an array of maps

If you’re using Postgres jsonb columns then you can do aggregates with one of the json aggregrate functions. Postgres aggregates are listed here.