Hello, I'm having trouble with how to write a 'relevant' conditional statement based the answers to previous fields. Here is some background information.
I have 5 fields:
My conditional statement is:
When the field Needed is Yes, ramp fields are enabled/disabled based on the Corner_Type:
Is it possible to write out all of the above scenarios in just one function?
Thank you in advance.
Casey
Can you confirm that bullet point three and four are both meant to say 'enabled'?
If so, I'd try this and see if it works as you need.
name | relevant |
---|---|
RAMP1 | ${NEEDED}='yes' |
RAMP2 | ${NEEDED}='yes' and ${CORNER_TYPE}!='D' |
RAMP3 | ${NEEDED}='yes' and ${CORNER_TYPE}!='D' and ${CORNER_TYPE}!='CD' |
If bullet three or four is meant to disable all RAMPs, just add another ${CORNER_TYPE}!=
Small modification - RAMP3 also needs
and ${CORNER_TYPE}!= 'ID'
RAMP3 could also be expressed by the valid values (as there are 3 valid values and 3 invalid values); this is the pattern I would use if the number of invalid values is larger than the number of valid values:
${NEEDED}='yes' and (${CORNER_TYPE}='IT' or ${CORNER_TYPE}='CS' or ${CORNER_TYPE}='I')
James's reply is one way to do it. Here is another approach. Both should work for you.