Hi everybody,
I'm trying to create a survey in which multiple fields are supposed to populate based on an answer selected in previous fields.
One example is field "points" which is supposed to populate based on the selected answer from a filed "monthly_income".
I've tried to create the following calculation for the field "points":
After creating the survey, the calculations work in preview mode, but not in the published, online survey.
Any suggestions?
Solved! Go to Solution.
Hi Martina,
You are using several statements that are joined together with 'or'; this would lead to a Boolean (true/false) calculation. You should instead use a nested series of if() statements to filter each option:
if(selected(${monthly_income}, 'do_2_000_00_kn'), '3', if(selected(${monthly_income}, 'od_2_001_00_3_000_00_kn'), '2', if(selected(${monthly_income}, 'od_3_001_00_3_500_00_kn'), '1', if(selected(${monthly_income}, 'vise_od_3500'), '0',''))))
Hi Martina,
You are using several statements that are joined together with 'or'; this would lead to a Boolean (true/false) calculation. You should instead use a nested series of if() statements to filter each option:
if(selected(${monthly_income}, 'do_2_000_00_kn'), '3', if(selected(${monthly_income}, 'od_2_001_00_3_000_00_kn'), '2', if(selected(${monthly_income}, 'od_3_001_00_3_500_00_kn'), '1', if(selected(${monthly_income}, 'vise_od_3500'), '0',''))))
Works perfectly. Thank you!