How to get a sum of the same element in a repeat group?

PaulT

Member
Does anyone know how to get a sum of the same element in a repeat group. For example if I have group called job done which is a repeat group. One element in that group is called Job Amount. In that field is entered the value of work that was done such as $125. The next repeat group may have $230 and so on. I want to have a non repeat group called Total Amount that is the sum of all these amounts, i.e. it is the total of all the Job Amounts that a person did on that day.
I am assuming the Total Amount Element would need to be a Calc plugin, but what would the calculation be for this?
 
I have 2 totals that are required one is a sum of Total Time and the other is a sum of Total Amount. I thought I would try to get the amount one working first as the time one may have formatting issues. With the amount one I tried this but it returned nothing as in blank.
return array_sum($_POST['join'][1]['geh_fortnight_summary_sheet_23_repeat___job_hours']);

I also tried this and had the same failed result:
$sum= array_sum($_POST['join'][1]['geh_fortnight_summary_sheet_23_repeat___job_amount']);
return $sum;

This seems strange as it appeared to work for railer in this post http://fabrikar.com/forums/index.ph...hout-creating-additional-records.35243/page-2
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top