- Posts: 105
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
{join( if(q1=="A2" and q2=="A2" and q3=="A2",'red',''), if(q1=="A1" and q2=="A2" and q3=="A2",'green',''), if(q1=="A1" and q2=="A1" and q3=="A2",'blue',''), if(q1=="A1" and q2=="A1" and q3=="A1",'yellow',''), '')}
www.limesurvey.org/manual/Expression_Manager#OperatorsHowever, we recommend using the join() function for concatenation, as that makes your intent more clear, and avoids unexpected results if you were expecting strings but got numbers instead (or vice versa).
Maybe in future Equation question type save line feedtpartner wrote: Why the join function? Since they are mutually exclusive, why not simply use four IF() statements (not nested)?
{if(q1=="A2" and q2=="A2" and q3=="A2",'red','')} {if(q1=="A1" and q2=="A2" and q3=="A2",'green','')} {if(q1=="A1" and q2=="A1" and q3=="A2",'blue','')} {if(q1=="A1" and q2=="A1" and q3=="A1",'yellow','')}
Duh...that's a rookie mistake, not catching thatUse dual equality == to compare values
Arg … my mistake … :Stpartner wrote:
Duh...that's a rookie mistake, not catching thatUse dual equality == to compare values