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')
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')