1

The Matrix docs say:

:average, :lowest, :highest, and :sum

These tags return the average, lowest, highest, or sum value of a given numeric column in your Matrix field.

I have a matrix field that is all about hours spent on different activities and different weeks. I not only want to get the sum of each column (the weeks) but also the sum of each row (the activities) and if possible get the sum of every cell in the whole table. Is that possible or do with just Matrix or do I need to install something like the Simple Math Add-on?

so instead of {matrix_field:sum col='week1'} is there something like {matrix_field:sum row_id="1"}

2 Answers 2

1

You could do this using Matrix and the Math add-on - but not in Matrix without any other add-ons/PHP. I hope that helps!

1
  • Not the answer I wanted, but the answer I expected. Thanks. Apr 30, 2013 at 7:55
0

If you are ok with php on output, how about

<?php
$my_row_sum = {matrix_field:sum col='week1'} + {matrix_field:sum col='week2'} + etc...;
?>
1
  • Yeah, great idea! ... but I need PHP on input. :( Apr 30, 2013 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.