helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 365 forks source link

An examples of working out averages on columns #411

Open adamgins opened 2 years ago

adamgins commented 2 years ago

HI, is there anyway to do this out of of the box, please?

Let's say we have a the following data as a set of rows:

[
{ Jan:1, Feb:2, Mar:3, Apr: 4, May: 5},
{ Jan:2, Feb:4, Mar:4, Apr: 9, May: 5},]

We'd like to work out the avegrate on the "columns" eg field "Jan", avg = 1 + 2/2 = 1.5

Is there a way to do this. I see "average" but not sure if there's a way to split into columns and store temporarily without writing a customer JS help?