Welcome to the LimeSurvey Community Forum

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

expression manager code for all combinations in a number array

  • TransportLab
  • TransportLab's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 1 month ago #148457 by TransportLab
I have a number array with 9 Y-subquestions (Y1, Y2...) and 9X-subquestions (X1, X2...).
Is is possible, when using EM to indicate all possible combinations?

Purpose:
I would like to validate that the sum of all different numbers entered in the matrix equals the input in a previous question and I would like to avoid writing the 81 combinations (VAR1_Y1_X1+VAR1_Y1_X2+....)

Note: I do not yet have javascripting experience so suggestions relating to EM approaches would be best.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #148459 by holch
I am not aware of such a thing. I guess you will have to go for the 81 combinations, probably. Maybe someone else has an idea on how this could be made easier.

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

The topic has been locked.
More
7 years 1 month ago #148462 by Ben_V
Hi,
Check out the manual (and older forum posts) about reserved 'this', 'self', and 'that' variables

manual.limesurvey.org/Expression_Manager....27that.27_variables

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: TransportLab
The topic has been locked.
More
7 years 1 month ago #148463 by jelo

TransportLab wrote: I would like to validate that the sum of all different numbers entered in the matrix equals the input in a previous question and I would like to avoid writing the 81 combinations (VAR1_Y1_X1+VAR1_Y1_X2+....)

You can save yourself a bit of typing. Depending on the question type you can access row, columns complete question via self,that. E.g. {sum(self.sq_nameofsubquestion)} which than expands internally without typing every variable.

To learn a bit about self that etc.
manual.limesurvey.org/Expression_Manager....27that.27_variables

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: tpartner, TransportLab
The topic has been locked.
  • TransportLab
  • TransportLab's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 1 month ago #148493 by TransportLab
Thanks a bunch. That saved me a lot of typing
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose