Error message on calculation for form

Hello,

I need help with this error below:

  • FormLogicError: Could not evaluate: if(( /model/instance[1]/data/Q9 =1), ‘0’, if(( /model/instance[1]/data/Q9 =2), ‘5’, and /model/instance[1]/data/Q9 =3),‘10’)), message: Weird args (should be separated by commas):[{“t”:“bool”,“v”:false},",",{“t”:“str”,“quote”:"’",“v”:“5”},{“t”:“bool”,“v”:false}]

this is the calculation statement below which I wrote:

if((${Q9}=1), ‘0’, if((${Q9}=2), ‘5’, and ${Q9}=3),‘10’))

Thanks

Hello,
Your syntax for the cascading if is wrong. It must be
if(condition1, true-action1,
if(condition2, true-action2,
if(condition3, true-action3, else3).

(An “and” or an “or” can only be part of a condition.)

1 Like

Kindly help me with the corrected syntax of my question:

And the scores assigned are:

No system: 0 points
Paper based system: 5 points
Electronic based system: 10 points

Hence could it be:

if(${Q9}=1,0
if(${Q9}=2,5
if(${Q9}=3,10,

@Faith, maybe this post discussed previously should give you a hint of how to create an if-statement: