Welcome, Guest
Username: Password: Remember me

TOPIC: about nested if syntax

about nested if syntax 7 months 2 weeks ago #104840

  • dolly_wen
  • dolly_wen's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
Hi, I was trying to use nested if statement, something like (these lines work):

{if(Calculation > 32, 'Right Handed',if(Calculation <= 32 && Calculation >=29,'Moderately Right Handed', if(Calculation <= 28 && Calculation >= 25, 'Weakly Right Handed',if(Calculation == 24, 'Ambidextrous', if(Calculation <= 23 && Calculation >=20, 'Weakly Left Handed', if(Calculation <=19 && Calculation >= 16, 'Moderately Left Handed', 'Strongly Left Handed' ) ) ) ) ) )}

I want my expression to span multiple lines (see the following), which is easier to read. I follow the example (manual.limesurvey.org/Expression_Manager#Conditional_Equations). I began a new line by pressing "Enter" and "Shift", but it does not work. Can anybody kindly help out?

{if(Calculation > 32,
'Right Handed',
if(Calculation <= 32 && Calculation >=29,
'Moderately Right Handed',
if(Calculation <= 28 && Calculation >= 25,
'Weakly Right Handed',
if(Calculation == 24,
'Ambidextrous',
if(Calculation <= 23 && Calculation >=20,
'Weakly Left Handed',
if(Calculation <=19 && Calculation >= 16, 'Moderately Left Handed',
'Strongly Left Handed'
)
)
)
)
)
)}
Last Edit: 7 months 2 weeks ago by dolly_wen.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.101 seconds
Donation Image