How to design a survey form that would automatically calculate a value for me while collecting data?

Good morning, I am preparing a questionnaire and one of the questions is the body mass index. How do I insert a field that automatically fills in when inserting in the previous questions the weight and height of the research participant?

Thank you

Hi @wendel,

Welcome to the community! You could design your survey form using the calculate function to compute the BMI of the respondent. For further understanding please feel free to have a look at the examples on how calculate is used while designing a survey form (it has been discussed previously here):

If you are still not able to grasp the examples laid out please feel free to reach us back.

Have a great day!

Thank you very much for your help, but in the examples I saw the result does not appear on the form for the interviewer at the time of collection. Would it have any way of being visible, so that the interviewer could guide the interviewee about the result obtained? I do not know if i was clear.

Thank you

1 Like

Hi @wendel,

For this, you should use the note question type as outlined here.

Have a great day!

Hello,
in addition to Kal_Lam: You could also set any variable with your calculation to read_only = true, (and required = true).
Kind regards

1 Like

But the note would be an explanation. What I wanted was for the weight and height to be filled in automatically to fill in another variable, which would be the body mass index. Thus automatically making the weight / (height x height) count. I don’t know if it would be possible.

Another question, is it possible to automatically fill in the variables that are “jump” with zero?

Thank you very much for your attention.

Hi,

Once you get familiar with using advanced calculate as explained in our article here you will notice that you can input a calculate function in most type of questions, in this case, this will be possible.

On your second query;

The fact that the questions are skipped means they would not get the value as 0, however you can still use them in a calculation by using the command “if”. This will allocate a 0 for it if it has a blank i.e. skipped and yet it was referenced in a calculation.
if(${SkippedQuestion}>=0,${SkippedQuestion},0).

An example in use would be
The total number of women + Total number of Children can be put as follows.
${totwomen}+(if(${totchildren}>=0,*${totchildren},0)

In the above example if the question “totchildren” was skipped then a value of 0 will be allocated prior to the computation.

Stephane

1 Like