- Posts: 60
- Thank you received: 6
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Referencing filtered array values with Expression Manager
- duvemyster
- Topic Author
- Offline
- Senior Member
Less
More
9 years 8 months ago - 9 years 8 months ago #111426
by duvemyster
Referencing filtered array values with Expression Manager was created by duvemyster
QFA is a filtered array, for which rows R1, R2, and R3 may or may not exist.
Where C1 is the first column, I'd like to utilize QFA_R1_C1, QFA_R2_C1, and QFA_R3_C1 in expression manager equations. However, these variable are only defined if their row is displayed.
Creating a hidden equation type question for each such value can achieve variables that are always defined whether or not their rows exist (i.e., Code: FORR3C1 | Question:{QFA_R3_C1} | and then utilize {FORR3C1} instead of {QFA_R3_C1} in subsequent EM formulas.)
But this can get to be a lot of expression type questions for larger arrays.
Question: Is there another way to ensure that {QFA_R3_C1} is always defined whether or not row R3 is filtered?
Where C1 is the first column, I'd like to utilize QFA_R1_C1, QFA_R2_C1, and QFA_R3_C1 in expression manager equations. However, these variable are only defined if their row is displayed.
Creating a hidden equation type question for each such value can achieve variables that are always defined whether or not their rows exist (i.e., Code: FORR3C1 | Question:{QFA_R3_C1} | and then utilize {FORR3C1} instead of {QFA_R3_C1} in subsequent EM formulas.)
But this can get to be a lot of expression type questions for larger arrays.
Question: Is there another way to ensure that {QFA_R3_C1} is always defined whether or not row R3 is filtered?
Last edit: 9 years 8 months ago by duvemyster.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
9 years 8 months ago #111439
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Referencing filtered array values with Expression Manager
Try:
Code:
{QFA_R3_C1.NAOK}
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: duvemyster
The topic has been locked.
- duvemyster
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 60
- Thank you received: 6
9 years 8 months ago #111457
by duvemyster
Replied by duvemyster on topic Referencing filtered array values with Expression Manager
Awesome. Thank you. Yes, that works.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
9 years 8 months ago #111461
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Referencing filtered array values with Expression Manager
No problem.
For the benefit of others, NAOK stands for "not applicable okay" and should always be used for variables from questions that may not be shown due to relevance or conditions.
.
For the benefit of others, NAOK stands for "not applicable okay" and should always be used for variables from questions that may not be shown due to relevance or conditions.
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- david2013
- Offline
- Senior Member
Less
More
- Posts: 42
- Thank you received: 6
9 years 8 months ago #111690
by david2013
Replied by david2013 on topic Referencing filtered array values with Expression Manager
Should we always use qcode.NAOK ? Is it there any situation that we should only use qcode (no .naok)?
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
9 years 8 months ago #111712
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Referencing filtered array values with Expression Manager
It makes sense to always use .NAOK. I am not aware of any drawbacks.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: david2013
The topic has been locked.