I have a survey that has a host of select_one questions. Each set of questions is categorized, each category has between 1 and 4 questions. The first thing i need to do is find the average score for each category of questions, and then find the total overall average.
The issue i'm having is that one of the categories has a relevant question. So the user is asked the first select_One question, and then if they select '1' (first option) they move on to the next category. If they select 2,3,or 4 from the first select_One question, they are presented with 3 more questions in that category.
I would like to get the average for that category by using an if statement, but i cant get it to work.
for example: if the answer to question 1 is '1', leave the total for this category as 1, otherwise tally up the answers to all the questions in this category and divide by the total number of questions.
I keep getting an error: Invalid calculate for the bind attached to ${calculatefield}
Here is my example. Field i'm trying to calculate is ${calculatefield}, type is decimal and bind type is decimal.
anyone have any ideas!?
if (selected(${Question1},'1')), number(${Question1}), (number(${Question1})+number(${Question2})+ number(${Question3})+ number${Question4}) div 4