Counting how many time an option was selected in a generic way

Hi to all,

This question is close to this one but different :wink:

Back to form definition for breeding birds counting protocol, locusts and grasshoppers :slight_smile:

Colleagues iterate in a repeat loop each time they see or ear a bird within 5 minutes.
I would like to find a generic way to count how many time a specific taxa have been seen during the field session (= selected in the list), in order to show the summary of the field sessions before form finalization. I can do such aggregation on the database side after the data have been submit to aggregate but I would like to satisfy this user need in a more generic way, without coding a calculate for each species of the list as I do here :

stoc.xlsx (33.8 KB)

That's a good one. Unfortunately I don't think there's a straightforward way to do this, certainly not in XLSForm. Would you use this in your analysis or mainly to show a summary to the data collector? I'm wondering because there are some things that could be considered with repeat but it would not be convenient for analysis.

Hi @LN,

Only to show à summary. There is no problem to get that result after form submission in our analysis. But enumerators need to check this summary in order to check they did not forgot any observation.

Would be glad to test :grinning: I was thinking about regexp to creae a kind of array in a string and then add this new value or add 1 to the count each time the new value matches the string...