I have an attendance form which asks for the training session and whether
the participant was present. I’ve added case properties for each session
which gives a 1 if the participant is present and a 0 if not, with a
display condition so that each one only does the calculation for the
correct session. What I’d like to do is have CommCare create a sum of all
of these case properties to give the total number of sessions each
participant attended.
This comes close to what I’m looking
for: https://wiki.commcarehq.org/display/commcarepublic/Incrementing+a+counter.
However, there are often duplicate forms filled out for each participant -
for example, if she is absent for the training in her village, but attends
one in a neighboring village the next day, there will be two attendance
forms submitted.
If the value that’s ‘1’ if the participant is present and ‘0’ if not is
stored at reference #form/present’ (for example) then you could replace the
calculation from the documentation with the calculation:
Thanks, Will! This would work some of the time, but we do get many
duplicate forms submitted for a variety of reasons (we’re working on
it…), so if that happens it would make the counter inaccurate. But in the
absence of a way of summing case properties from different forms, I will
definitely give this a shot and keep track of the number of duplicate forms
sent.
Cheers,
-Eric
···
On Thu, Nov 3, 2016 at 3:54 PM, William Pride wrote:
Eric,
If the value that’s ‘1’ if the participant is present and ‘0’ if not is
stored at reference #form/present’ (for example) then you could replace the
calculation from the documentation with the calculation: