As suggested at https://moodle.org/mod/forum/discuss.php?d=140433&parent=991346 you can aggregate formulas with the same higher indices. So, for instance, the formula
will display the sum total of all the formulas that look like
anywhere in the view.
will display the sum total of all the F1 formulas + the average of all the F2 formulas.
The rule is that the aggregated formulas must have a higher index than the aggregating formula.
It becomes a bit tricky if you want both line totals and column totals. For line totals you would typically use the entry id as the index of the aggregated formula since it is unique per line. Something like:
But that won't work for column total. It seems that currently the only way to do that is to add another hidden formula in each cell for the column totals. So you could have something like:
%%F[[entryid] ]:=...%% <span class="hide">%%F1:=...%%</span>
Both formulas will yield the same figure in the cell but only one will be displayed. The line total will use the first and the column total will use the second.
To reduce clutter in the view template you can use designated text fields for complex formulas. You enter the formula in the field's template and use the pattern [[T@fieldname] ]. The field template currently doesn't support html so you would have to add the html for hiding the second in the view template. This could look something like:
[[T@LineFormula] ] <span class="hide">[[T@ColumnFormula] ]</span>
Again, this technique is useful mainly when you have long formulas in complex view templates.