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 |

EditedThis is a bug. Change calcField from type calculate to integer and everything works.

I just added a bogus relavent expression for calcField so its never displayed to the user.

Adding column bind::type and setting it to Integer also works. In this case you can leave the calcField to be type calculate.