How to create a "relevant" code with multiple AND/OR functions

Hello community,

I am having trouble creating a relevant code with multiple AND/OR functions. Below is what I am trying to do:

(selected(${cohort_year},'2003') and selected(${cohort_month},'january') or selected(${cohort_month},'february') or selected(${cohort_month},'march'))

I have about 40 of these types of codes. In short, if you select some but not all months of a specific year, you progress to the next step. Will I be forced to break down this code to something like the following. If possible, I really want to figure out how to keep the coding bundled into one string, like the example I have pasted above.

(selected(${cohort_year},'2003') and selected(${cohort_month},'january')
(selected(${cohort_year},'2003') and selected(${cohort_month},'february')
(selected(${cohort_year},'2003') and selected(${cohort_month},'march')

Thanks,
CJ

What trouble are you having?

Note that you may need to use parentheses to group your expression. i.e.,
did you want

( '2003' ... and ... 'january' ) or 'february' or 'march'

or did you want

'2003' and ( 'january' or 'february' or 'march' )

Parentheses are your friend. Use them.

ยทยทยท On Thu, Sep 4, 2014 at 7:31 AM, wrote:

Hello community,

I am having trouble creating a relevant code with multiple AND/OR
functions. Below is what I am trying to do:

(selected(${cohort_year},'2003') and selected(${cohort_month},'january')
or selected(${cohort_month},'february') or
selected(${cohort_month},'march'))

I have about 40 of these types of codes. In short, if you select some but
not all months of a specific year, you progress to the next step. Will I
be forced to break down this code to something like the following. If
possible, I really want to figure out how to keep the coding bundled into
one string, like the example I have pasted above.

(selected(${cohort_year},'2003') and selected(${cohort_month},'january')
(selected(${cohort_year},'2003') and selected(${cohort_month},'february')
(selected(${cohort_year},'2003') and selected(${cohort_month},'march')

Thanks,
CJ

--

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.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com