I appreciate your help with this expression if((${MH_Q1}=1),1, if((${MH_Q1}=2),2, if({$MH_Q1}=3),3, if({MH_Q1}=4),4, if({MH_Q1}=5),5, ’ ')))))

I appreciate your help
if((${MH_Q1}=1),1, if((${MH_Q1}=2),2, if({$MH_Q1}=3),3, if({MH_Q1}=4),4, if({MH_Q1}=5),5, ’ ')))))

if MH_Q1 is equal to 1 then 1 and so on

This is not working, please help

if((${MH_Q1}=1),1,if((${MH_Q1}=2),2,if((${MH_Q1}=3),3,if((${MH_Q1}=4),4,if((${MH_Q1}=5),5,‘’))))))

Welcome to the community, @zeinabeldirani! Could you also let the community know if ${MH_Q1} is a single or multiple response question type? If you are still stuck with this issue, please feel free to share the relevant part of your XLSForm with the community.

Please also be informed that we have a lot of community discussions on the if-statement here. Maybe that should be helpful for you to understand how it works.

Did you check your form with the Online validator?

1 Like

try this one:
if(${MH_Q1}=1),1, if(${MH_Q1}=2),2, if(${MH_Q1}=3),3, if(${MH_Q1}=4),4, if(${MH_Q1}=5),5, ’ ')))))

1 Like

The last ’ ’ should probably be ‘’ (empty).

What is the type of :MH_Q1? If it is not integer you may need to use ‘1’ etc.

1 Like