Welcome to the LimeSurvey Community Forum

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

Using EM for answer options - List (radio)

  • ChacoKevy
  • ChacoKevy's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 4 months ago #160195 by ChacoKevy
Hi all,
Currently using Version 2.62.2+170303
This is a question that's been asked previously, but was asked in previous versions, so just seeing if there is an update on how to go about this; how to conditionally display an answer option in a list-radio question based on (insert your criteria here (mine is a check to TOKEN:ATTRIBUTE_XX))?
I like using the relevance equation fields provided for sub-questions in array questions, but the fields don't appear alongside the answer option fields in list radio questions. Is it still the case, then, to come up with some javascript?
Thanks all!
CK
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 4 months ago #160201 by Joffm
Replied by Joffm on topic Using EM for answer options - List (radio)
Hi, CK,
if the previous question is a multiple question you use array filter.
Like:
Q1: Which car brands are you aware of? (multiple)
Q2: Which is you preferred brand? (single with array filter Q1)

if the previous question is single you have to insert a hidden multiple where you check by equation. And again array filter.
Like:
Q1: Which cars do you prefer? (italian, german, french, japanese, korean)
M1: hidden multiple with answer options of Q2,
eqM1: hidden equation like {M1_SQ001=if(Q1==1,"Y","")}, {M1_SQ002=if(Q1==1,"Y","")}, {M1_SQ002=if(Q1==2,"Y","")}, ...
Q2: And more detailled, which brand do you prefer? (only show brands of the selected country) array filter M1.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • ChacoKevy
  • ChacoKevy's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 4 months ago #160229 by ChacoKevy
Replied by ChacoKevy on topic Using EM for answer options - List (radio)
Thanks for chiming in,Joffm
I've not used array filters before, so this is me on the learning curve. That said, I'm not sure how to go about using an array filter for what I'm trying to do. The LS manual says array filters are to be used when checking against what was input as answers to previous questions. That's not what I'm doing.
I need to make a list-radio question to display options based on a check to the Token table.
Example:
Who are you?
A1: An associate (TOKEN:ATTRIBUTE_1=="Associate")
A2: A team member (TOKEN:ATTRIBUTE_1=="Team Member")
A3: Employee
Where only one would be displayed.
Thanks again for any feedback!
-CK
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 4 months ago #160232 by Joffm
Replied by Joffm on topic Using EM for answer options - List (radio)
Hello,
as I said
1. create a hidden multiple question (M1) with these three options.
2. create an equation: eqM1:
{M1_SQ001=if(TOKEN:ATTRIBUTE=="Associate","Y","")}
{M1_SQ002=if(TOKEN:ATTRIBUTE=="Team Member","Y","")}
{M1_SQ003=if(TOKEN:ATTRIBUTE=="Employee","Y","")}

3. Set the array filter of your question to M1.

The LS manual says array filters are to be used when checking against what was input as answers to previous questions. That's not what I'm doing.

This is exactly what you do in this case. You check against the input in the previous question (M1), nevertheless how the input takes place, by typing or by an equation

Please, have a look into the sample surveys, especially here: manual.limesurvey.org/Expression_Manager...cading_Array_Filters

Best regards
Joffm

And of course: Send a sample of your survey with these questions. (*.lss)

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • ChacoKevy
  • ChacoKevy's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 4 months ago #160236 by ChacoKevy
Replied by ChacoKevy on topic Using EM for answer options - List (radio)
Boom - got it. Thanks.
Sorry I was slow and didn't pick up on the notion of the hidden question when you first mentioned it. That was clever.
-CK
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose