Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How to add numbers and show the total in the final question

  • baburam99
  • baburam99's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 8 months ago #186798 by baburam99
Hi there
I am trying to generate a survey that will add the numbers from 3 or so questions and display it on the final question.
What kind of equation I should use?
What kind of choices should I use like array short text, multiple short text etc?
Appreciate the help.
Here is the simple survey I have attached.
Thanks
Babu
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186821 by Joffm
Hi,
1. the logic file already showed you your error in Q4.
a. What do you want to validate?
b. As Q1-Q3 are questions with subquestions you have to use the correct QCode.

2. This is only an example, isn't it? In real the questions will have more subquestions?

Didn't you read this

Having read this

"Here are the details of how to construct a Qcode (and access some properties) by question type. In general, Qcodes are constructed as:
QuestionCode . '_' . SubQuestionID . '_' . ScaleId"


you know that your equation has to look like this:
{sum(QuestionCode_SubQuestionCode1,QuestionCode_SubQuestionCode2,QuestionCode_SubQuestionCode3,...)}


As said your equation is {sum(Q1_SQ001.NAOK,Q2_SQ001.NAOK,Q3_SQ001.NAOK)}
As last page use a question of type "text display" where you can use this equation.
Like: "And the sum of all vehicles is {sum(Q1....)}"



And if there are more than one subquestion in each question (not the best to use "multiple numerical" with only one subquestion) you can use the "that" operator, which I wrote before, too.

I really recommend to read the manual and study the demo surveys; either in the demo installation ("Resources / Demo") here or download and import them.
manual.limesurvey.org/Expression_Manager_sample_surveys

Joffm

By the way:
This question obviously is not a question about the further development of LimeSurvey, but more a "Can I do..."

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose