- Posts: 13
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
questioncode_subquestioncode.value
G1Q1_1.value G1Q1_2.value G1Q1_3.value
{sum(that.myarray.sq_2.NAOK)}
You can also use these to get row and column totals. Say you have a array of numbers with rows A-E and columns 1-5.
What is the grand total? {sum(self.NAOK)}
What is the total of row B? {sum(self.sq_B.NAOK)}
What is the total of column 3? {sum(self.sq_3.NAOK)}
The 'that' variable is like the 'self' variable, but lets you refer to other questions. Its syntax is:
that.qname
that.qname.suffix
that.qname.sub-selector
that.qname.sub-selector.suffix
qname is the question name without any sub-question extensions. So, say you create a question 'q1', that is its qname
Examples:
Has any part of question q1 been answered? {count(that.q1.NAOK)>0}
What is the assessment score for q2? {sum(that.q2.NAOK)}
What is the grand total of q3? {sum(that.q3.NAOK)}
What is the total of row C in q4? {sum(that.q4.sq_C.NAOK)}
What is the total of column 2 in q4? {sum(that.q4.sq_2.NAOK)}
The 'self' and 'that' variables can be used in any relevance, validation, or tailoring.
The one caveat is that when you use the Show Logic File feature, it will show you the expanded value of 'self' and 'that'. This lets you see the actual equation that will be generated so that you (and Expression Manager) can validate that the variables exist. This may seem confusing since you may see quite lenghty equations. However, if you edit the question, you will see the original equation using 'self' and/or 'that'