Multiple selection validation

Hi Yaw?
I want to hinder selection of a 'none' choice option and other options in
the list. The other options are names of RH organizations. So one can only
select multipe organization's without selecting none.

I tried;
'Constraint'
not (selected., '0') or selected(., '1') or selected (., '2') or
selected(., '3') or selected(., '4') or selected(., '5') or selected(.,
'99'))

0 is none 1/5 Are different organizations and 99 is other specify.

Thanks in advance.

Louis...

··· On 26 Nov 2015 08:01, "Louis Omoya" wrote:

Louis,

Try not(selected(.,'0') and count-selected(.) > 1)

Yaw

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Thu, Nov 26, 2015 at 12:26 PM, Louis Omoya louisomoya@gmail.com wrote:

On 26 Nov 2015 08:01, "Louis Omoya" louisomoya@gmail.com wrote:

Hi Yaw?
I want to hinder selection of a 'none' choice option and other options in
the list. The other options are names of RH organizations. So one can only
select multipe organization's without selecting none.

I tried;
'Constraint'
not (selected., '0') or selected(., '1') or selected (., '2') or
selected(., '3') or selected(., '4') or selected(., '5') or selected(.,
'99'))

0 is none 1/5 Are different organizations and 99 is other specify.

Thanks in advance.

Louis...

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

1 Like

Hi Yaw?
Thanks for the response. It works, though I have used >=2.
What is the difference in not(selected(.,'0') and count-selected(.) > 1)
when >1 or >2 is used?

I would also like to share something I have been working on.

So I wanted to make a multiple choice validation for a question about
source of IUCD with following choices.

  1. Facility doesn't offer IUCD.

  2. Government Medical stores.

  3. NGO providers.

  4. Wholesaler distributor.

  5. Drug factory.

  6. Registered pharmacy.

  7. General wholesaler.

  8. Don't Know.

  9. Facility has never stocked IUCD.

The challenge is to restrict a selection of Choice 1, 8 and 9 as a
combination. I also wanted to restrict a selection of 1, 8, 9 as a
combination with any other choice. In short only single select 1,8,9 if 1
or 8 or 9 is selected.

After playing around with a suggestion from Yaw, I succeeded;

"not(selected(., '1') and count-selected(.)>=2) and not(selected(., '8')
and count-selected(.)>=2) and not(selected(., '9') and
count-selected(.)>=2)"

I hope this will help someone who will need it.

Louis...

··· On Thu, Nov 26, 2015 at 2:43 PM, Yaw Anokwa wrote:

Louis,

Try not(selected(.,'0') and count-selected(.) > 1)

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Thu, Nov 26, 2015 at 12:26 PM, Louis Omoya louisomoya@gmail.com wrote:

On 26 Nov 2015 08:01, "Louis Omoya" louisomoya@gmail.com wrote:

Hi Yaw?
I want to hinder selection of a 'none' choice option and other options
in

the list. The other options are names of RH organizations. So one can
only

select multipe organization's without selecting none.

I tried;
'Constraint'
not (selected., '0') or selected(., '1') or selected (., '2') or
selected(., '3') or selected(., '4') or selected(., '5') or selected(.,
'99'))

0 is none 1/5 Are different organizations and 99 is other specify.

Thanks in advance.

Louis...

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Louis,

count-selected() counts the number of selected items in the prompt. So

X is if you want the number of selected things greater than X

Yaw

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Sat, Nov 28, 2015 at 4:17 AM, Louis Omoya louisomoya@gmail.com wrote:

Hi Yaw?
Thanks for the response. It works, though I have used >=2.
What is the difference in not(selected(.,'0') and count-selected(.) > 1)
when >1 or >2 is used?

I would also like to share something I have been working on.

So I wanted to make a multiple choice validation for a question about source
of IUCD with following choices.

  1. Facility doesn't offer IUCD.

  2. Government Medical stores.

  3. NGO providers.

  4. Wholesaler distributor.

  5. Drug factory.

  6. Registered pharmacy.

  7. General wholesaler.

  8. Don't Know.

  9. Facility has never stocked IUCD.

The challenge is to restrict a selection of Choice 1, 8 and 9 as a
combination. I also wanted to restrict a selection of 1, 8, 9 as a
combination with any other choice. In short only single select 1,8,9 if 1 or
8 or 9 is selected.

After playing around with a suggestion from Yaw, I succeeded;

"not(selected(., '1') and count-selected(.)>=2) and not(selected(., '8') and
count-selected(.)>=2) and not(selected(., '9') and count-selected(.)>=2)"

I hope this will help someone who will need it.

Louis...

On Thu, Nov 26, 2015 at 2:43 PM, Yaw Anokwa yanokwa@nafundi.com wrote:

Louis,

Try not(selected(.,'0') and count-selected(.) > 1)

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Thu, Nov 26, 2015 at 12:26 PM, Louis Omoya louisomoya@gmail.com wrote:

On 26 Nov 2015 08:01, "Louis Omoya" louisomoya@gmail.com wrote:

Hi Yaw?
I want to hinder selection of a 'none' choice option and other options
in
the list. The other options are names of RH organizations. So one can
only
select multipe organization's without selecting none.

I tried;
'Constraint'
not (selected., '0') or selected(., '1') or selected (., '2') or
selected(., '3') or selected(., '4') or selected(., '5') or selected(.,
'99'))

0 is none 1/5 Are different organizations and 99 is other specify.

Thanks in advance.

Louis...

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google
Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send
an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

2 posts were split to a new topic: Issue with the use of count-select( )