Equation question type | LimeSurvey

Equation

About Equation

An Equation question calculates a value from other answers and stores it with the response. Participants do not answer it: they see the result, or nothing if you hide the question. Use it for totals, scores, ages from a year of birth, or any value you want in your data without calculating it later.

An Equation question as participants see it, with two areas numbered 1 and 2, three numbers entered in the question above and the total calculated from them

In the picture: 1 the answers to a Multiple numerical input question, 2 the Equation question with the text Total hours per week: {sum(Q024_SQ001, Q024_SQ002, Q024_SQ003)}. The total updates while participants type.

Add an Equation question

  1. Click the purple + in the top bar. The question type picker opens.

  2. Under Number, click Equation. The question appears at the end of the current question group. Keep it after the questions whose answers it uses.

  3. Click Your question here and type the calculation in curly brackets, for example {Q023 * 12} for the yearly value of a monthly answer in question Q023.

Settings that matter

Select the question to open its settings on the right.

  • Always hide this question (Advanced > Display): hides the question from participants. The value is still calculated and stored.
  • SPSS export scale type (Advanced > Other): tells SPSS whether the stored value is nominal, ordinal or scale.

How the answers are stored

The equation stores the text it shows, with the calculated values in it. With the text Total hours per week: {sum(...)} the stored value is "Total hours per week: 36". To store only the number, write only the calculation into the question text, for example {sum(Q024_SQ001, Q024_SQ002, Q024_SQ003)}, and hide the question.

Next steps

FAQ

Where do I find the codes I need in the calculation?

Open the ... menu at the top right of the editor and switch on Question codes under View. See Question and answer codes.

Can I use the result of an Equation in a condition?

Yes, if its question text contains only the calculation, so that the stored value is a number. Then use its code like any other answer, for example Q025 > 40.