Welcome to the LimeSurvey Community Forum

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

Sum in Array Dual Scale

  • ch123
  • ch123's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 5 months ago #190793 by ch123
Sum in Array Dual Scale was created by ch123
Hi all.
Hopefully you can help me again :)
I have a question of type Array Dual Scale (30 items, scale1: today, scale2: last week) and I want to calculate the sum of different subscales seperated by the two scales.
I thought about doing this with questions of type equation and expression manager. But I can't use the expression {sum(VAR01,VAR02,VAR03)} - probably because of the dual scale (that makes sense to me, because you haven't defined the scale). Is there a possibility to get the different sums? Or is it possible to have two single scale array questions and put them together with coding or something?

Thank you!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190801 by holch
Replied by holch on topic Sum in Array Dual Scale
You need to access the dual scale differently:
manual.limesurvey.org/Expression_Manager...tion_with_two_scales

It has 3 dimensions:
1. Subquestions
2. Answeroptions
3. Scale

So let's assume you have 3 subquestions and for these 3 subquestions (SQ1, SQ2 and SQ3) you want to have the sum of the answer options given for today (1st scale = 0).

Then you would need something like this:
Code:
{sum(QuestionCode_SQ1_0, QuestionCode_SQ2_0,QuestionCode_SQ3_0)}

Not tested though. You might have to play around with this a little bit.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: ch123
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190803 by Joffm
Replied by Joffm on topic Sum in Array Dual Scale
Hi,
in my opinion the best you can do is:
  1. Activate the survey
  2. Enter some well defined data
  3. In the answer table you see how the results are stored and which code to use
  4. Deactivate the survey
  5. Proceed

Or just create a survey with this question you want to inspect.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: ch123
The topic has been locked.
  • ch123
  • ch123's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 5 months ago #190811 by ch123
Replied by ch123 on topic Sum in Array Dual Scale
Thank you both! Really nice community :)
It was easier than expected. Actually it worked with the "_0" at the end for the first scale and "_1" for the second scale.

So, here's the solution for someone with the same problem:
Code:
1. scale: {sum(Q1_SQ1_0, Q1_SQ2_0,Q1_SQ3_0,...)}
2. scale: {sum(Q1_SQ1_1, Q1_SQ2_1,Q1_SQ3_1,...)}
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose