Here's the general layout of the form. If selField = a, I want to set calcField to 1 for the repeat record.
Then, the calculation in sumVal field should tally all the repeat records that have a value of 'a'.
Well, the first sumVal is 1 if 'a' is selected, then you add a repeat select 'a' again, now the sumVal is 11.
So, the sum() calculation is concatenating the 1's and not adding them. How do you get around this??
I have calcField and sumVal fields set to ESRI type Integer.
| type | field_name | calculation |
|---|
| integer | sumVal | sum(${calcField}) |
| begin repeat | relatedTable | List of Repeats |
| select_one choiceList | selField | |
| calculate | calcField | if(selected(${selField},'a',1,0) |
| end repeat | | |