Create a Final Survey Question: Sum of all Array values

More
1 month 3 weeks ago #184844 by bpbpbp
Hi!

This is my first post and my first trial survey creation.

I have 1 survey, 1 question group with 7 questions.

Question #1, #3 and #5 are all Array(5) questions, storing values 1 to 5 I presume, each with 4 sub-questions.

I create a final question (#7) as an Equation, and I want to know the correct code to sum all sub-questions of #1, #3 and #5.

I don't know where to begin, and the documentation is very detailed but overwhelming..

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
1 month 3 weeks ago #184848 by holch
You will not manage to work with equations without reading about EM within the manual. But I can understand that it is overwhelming. To find out on how to address a certain question/subquestion/answer, it helps to look at the question logic files, because it shows you, how this is addressed.

Now here an example for array questions. You have two factors here that you need to take in to account: subquestions and answer options.

As you want to know the value of the answer option, you to read this into your equation, which can be done by something like this:
{questioncode_subquestioncode}

So let's assume your first question has the question code "Q1" and the subquestions are called SQ1, SQ2, SQ3 and SQ4.

So you'll get the answer code subquestion 1 like this:
{Q1_SQ1}

So to get a sum of all responses to Q1 you would do something like:
{sum(Q1_SQ1, Q1_SQ2, Q1_SQ3, Q1_SQ4)}

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #184850 by DenisChenu
Personnaly my advice for equatiuon is

1. use gui editor equation to know Question Variables
2. Start with simple part : == != ge …
3. Add count an sum
4. After : get a bookmark to EM available function …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #184933 by bpbpbp
Thank you I will give it a try!

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #184934 by bpbpbp
Thanks for your suggestion, however as a newbie I don't understand your instructions at all, sorry!

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #184939 by DenisChenu

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #184972 by cdorin

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!