Calculated Variables

Dear Survey solution,

we have several calculated variables that we will import to SQL database. I have a problem now that when one question is not answered (one of the variables needed for the calculated variable), i get an error instead of 0. This is pretty frequent for multiplication and division variables.

Do I save the problem by writing the calculated variable (wax_sol??0)*(wax_pri??0)?? would it solve the problem for the division as well?

Thank you so much

There is probably more than 1 answer to this question.

If the error is issued by your SQL database that doesn’t like missing values for some reason, you can probably avoid the issue by marking these variables “Do not export”. Then you can calculate them if needed already in SQL DB with equivalent expressions.

The problem is, however, more generic, since you will have also questions that are skipped or not answered, so you need to consult your SQL system documentation on the recommendations for storing missing values. Storing 0 instead is not always a good idea. Survey Solutions’ documentation describes Missing values.