Can you sum values based on a multiple choice answer in Survey 123?

989
1
Jump to solution
10-13-2017 03:14 PM
Labels (1)
J_P_Montagne
New Contributor II

I have a select_multiple field with 5 possible answers. Each answer represents a different value. e.g.:

___ AA = 1

___ BB = 2

___ CC = 3

___ DD = 4

I would like the next field to sum the values base on what is checked by the user. i.e., if CC and DD are both checked, the next field would display 7. Is there an easy way to do this? 

1 Solution

Accepted Solutions
J_P_Montagne
New Contributor II

my colleague figured it out.

if(selected(${field}, 'AA'), 1, 0) + if(selected(${field}, 'BB'), 2, 0) + if(selected(${field}, 'CC'), 3, 0) + if(selected(${field}, 'DD'), 4, 0) + if(selected(${field}, 'EE'), 5, 0)

View solution in original post

1 Reply
J_P_Montagne
New Contributor II

my colleague figured it out.

if(selected(${field}, 'AA'), 1, 0) + if(selected(${field}, 'BB'), 2, 0) + if(selected(${field}, 'CC'), 3, 0) + if(selected(${field}, 'DD'), 4, 0) + if(selected(${field}, 'EE'), 5, 0)