Creating contraints on select_multiple

Hi all,
For question with select_multiple (below), I'd like to create a
constraint so that if someone either enters a 88 or 99, they can not select
any other answer choice.

list-name value label
use 1 use choice #1
use 2 use choice #2
use 3 use choice #3
use 4 use choice #4
use 5 use choice #5
use 6 use choice #6
use 88 Refuse
use 99 Don't know

I think this post,http://bit.ly/1yj4MHn, had the solution, but none of my
attempts to put together something like: "not(selected(., 88) and
count-selected(.) >=2) or not(selected(., 99) and count-selected(.) >=2)"
seem to work.

could someone spot me some wisdom?

1 Like

Did you use the quotes around the choice value in the constraint?

i.e. try using not(selected(., '88') and count-selected(.) >=2) or not(selected(.,
'99') and count-selected(.) >=2)

··· On Saturday, 31 January 2015 18:48:48 UTC+6, Bill Olander wrote: > > Hi all, > For question with select_multiple (below), I'd like to create a > constraint so that if someone either enters a 88 or 99, they can not select > any other answer choice. > > list-name value label > use 1 use choice #1 > use 2 use choice #2 > use 3 use choice #3 > use 4 use choice #4 > use 5 use choice #5 > use 6 use choice #6 > use 88 Refuse > use 99 Don't know > > I think this post,http://bit.ly/1yj4MHn, had the solution, but none of > my attempts to put together something like: "not(selected(., 88) and > count-selected(.) >=2) or not(selected(., 99) and count-selected(.) >=2)" > seem to work. > > could someone spot me some wisdom? > >

Hi Bill, I believe the below should work when placed in constraint.

(not(selected(.,'88') and(selected(., '1') or selected(., '2') or
selected(., '3') or selected(., '4') or selected(., '5') or selected(.,
'6')or selected(., '99')))) or (not(selected(.,'99') and(selected(., '1')
or selected(., '2') or selected(., '3') or selected(., '4') or selected(.,
'5') or selected(., '6')or selected(., '88'))))

··· On Saturday, January 31, 2015 at 7:48:48 AM UTC-5, Bill Olander wrote: > > Hi all, > For question with select_multiple (below), I'd like to create a > constraint so that if someone either enters a 88 or 99, they can not select > any other answer choice. > > list-name value label > use 1 use choice #1 > use 2 use choice #2 > use 3 use choice #3 > use 4 use choice #4 > use 5 use choice #5 > use 6 use choice #6 > use 88 Refuse > use 99 Don't know > > I think this post,http://bit.ly/1yj4MHn, had the solution, but none of > my attempts to put together something like: "not(selected(., 88) and > count-selected(.) >=2) or not(selected(., 99) and count-selected(.) >=2)" > seem to work. > > could someone spot me some wisdom? > >

Hi Adeeb,
Thanks for taking a stab.
For some reason that seem to work either. that only produces an error
message if 88 and 99 are selected together. anything else i could be
missing?
thanks,
Bill

··· On Sunday, February 1, 2015 at 4:23:10 AM UTC, Adeeb Choudhury wrote: > > Did you use the quotes around the choice value in the constraint? > > i.e. try using not(selected(., '88') and count-selected(.) >=2) or not(selected(., > '99') and count-selected(.) >=2) > > > > On Saturday, 31 January 2015 18:48:48 UTC+6, Bill Olander wrote: >> >> Hi all, >> For question with select_multiple (below), I'd like to create a >> constraint so that if someone either enters a 88 or 99, they can not select >> any other answer choice. >> >> list-name value label >> use 1 use choice #1 >> use 2 use choice #2 >> use 3 use choice #3 >> use 4 use choice #4 >> use 5 use choice #5 >> use 6 use choice #6 >> use 88 Refuse >> use 99 Don't know >> >> I think this post,http://bit.ly/1yj4MHn, had the solution, but none of >> my attempts to put together something like: "not(selected(., 88) and >> count-selected(.) >=2) or not(selected(., 99) and count-selected(.) >=2)" >> seem to work. >> >> could someone spot me some wisdom? >> >>

Hey all, (and thanks Adeeb and LloydO
This ended up working and had the advantage of being concise: "if(selected(.,
'88') or selected(., '99'), count-selected(.)=1, count-selected(.)>=1)"
Big ups to SurveyCTO.

··· On Monday, February 2, 2015 at 1:36:28 AM UTC, Lloyd Owen Banwart wrote: > > Hi Bill, I believe the below should work when placed in constraint. > > (not(selected(.,'88') and(selected(., '1') or selected(., '2') or > selected(., '3') or selected(., '4') or selected(., '5') or selected(., > '6')or selected(., '99')))) or (not(selected(.,'99') and(selected(., '1') > or selected(., '2') or selected(., '3') or selected(., '4') or selected(., > '5') or selected(., '6')or selected(., '88')))) > > On Saturday, January 31, 2015 at 7:48:48 AM UTC-5, Bill Olander wrote: >> >> Hi all, >> For question with select_multiple (below), I'd like to create a >> constraint so that if someone either enters a 88 or 99, they can not select >> any other answer choice. >> >> list-name value label >> use 1 use choice #1 >> use 2 use choice #2 >> use 3 use choice #3 >> use 4 use choice #4 >> use 5 use choice #5 >> use 6 use choice #6 >> use 88 Refuse >> use 99 Don't know >> >> I think this post,http://bit.ly/1yj4MHn, had the solution, but none of >> my attempts to put together something like: "not(selected(., 88) and >> count-selected(.) >=2) or not(selected(., 99) and count-selected(.) >=2)" >> seem to work. >> >> could someone spot me some wisdom? >> >>
1 Like

Thanks Bill, I hadn't thought of using the if statement in this situation,
this will save me loads of time when I have many response codes!

··· On Tuesday, February 3, 2015 at 9:51:04 AM UTC-5, Bill Olander wrote: > > Hey all, (and thanks Adeeb and LloydO > This ended up working and had the advantage of being concise: "if(selected(., > '88') or selected(., '99'), count-selected(.)=1, count-selected(.)>=1)" > Big ups to SurveyCTO. > > On Monday, February 2, 2015 at 1:36:28 AM UTC, Lloyd Owen Banwart wrote: >> >> Hi Bill, I believe the below should work when placed in constraint. >> >> (not(selected(.,'88') and(selected(., '1') or selected(., '2') or >> selected(., '3') or selected(., '4') or selected(., '5') or selected(., >> '6')or selected(., '99')))) or (not(selected(.,'99') and(selected(., '1') >> or selected(., '2') or selected(., '3') or selected(., '4') or selected(., >> '5') or selected(., '6')or selected(., '88')))) >> >> On Saturday, January 31, 2015 at 7:48:48 AM UTC-5, Bill Olander wrote: >>> >>> Hi all, >>> For question with select_multiple (below), I'd like to create a >>> constraint so that if someone either enters a 88 or 99, they can not select >>> any other answer choice. >>> >>> list-name value label >>> use 1 use choice #1 >>> use 2 use choice #2 >>> use 3 use choice #3 >>> use 4 use choice #4 >>> use 5 use choice #5 >>> use 6 use choice #6 >>> use 88 Refuse >>> use 99 Don't know >>> >>> I think this post,http://bit.ly/1yj4MHn, had the solution, but none >>> of my attempts to put together something like: "not(selected(., 88) >>> and count-selected(.) >=2) or not(selected(., 99) and >>> count-selected(.) >=2)" seem to work. >>> >>> could someone spot me some wisdom? >>> >>>