Problem using the sum aggregation function

796
2
Jump to solution
07-28-2017 05:05 AM
OlivierDemars
New Contributor II

Hi,

I want to check that 2 specific choices have been selected for 2 items inside a repeat. I thought about using the sum aggregation function to do that, assigning a value to both choices and putting a constraint on the sum.

Unfortunately, the sum result gives me 12 when I was expecting 3. The values 1 and 2 are concatenated instead of being added.

See attached form. 

0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi Olivier,

seelct_one questions by default are strings, so the summation would normally be a concatenation.  Normally, this can be altered by setting the bind::type column to integer - bind::type controls the type of value in the form.  However, I'm seeing issues validating a form with a select_one in a repeat to a different type.  The workaround would be to create a calculate question with the value that is set to the correct type (they default to strings as well), and use that for the calculation (see attached).

View solution in original post

2 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Olivier,

seelct_one questions by default are strings, so the summation would normally be a concatenation.  Normally, this can be altered by setting the bind::type column to integer - bind::type controls the type of value in the form.  However, I'm seeing issues validating a form with a select_one in a repeat to a different type.  The workaround would be to create a calculate question with the value that is set to the correct type (they default to strings as well), and use that for the calculation (see attached).

OlivierDemars
New Contributor II

Thanks James, this workaround works for me.

0 Kudos