- Posts: 5
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Show question when a specific option is one of the selected items in a ranked q
- Aaargh
- Topic Author
- Offline
- New Member
Less
More
1 year 5 months ago #233508
by Aaargh
Show question when a specific option is one of the selected items in a ranked q was created by Aaargh
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 5.4.9+221101
Own server or LimeSurvey hosting: own server
Survey theme/template: fruity
==================
I have a ranked question with a bunch of options, one of which is "other.." if the participant uses this as any of their choices, I want to show an additional large-text question allowing them to elaborate.
What I'm struggling with is how to set up the condition for this field. I can of course do (pseudocode): "if rank1 == other || rank2 == other || rank3" but that gets old fast if you have a lot of options. Is there a way to simply do something like: "q1.selectedOptions.contains(other)" ?
I can't find anything like this in the manual.
Your LimeSurvey version: Version 5.4.9+221101
Own server or LimeSurvey hosting: own server
Survey theme/template: fruity
==================
I have a ranked question with a bunch of options, one of which is "other.." if the participant uses this as any of their choices, I want to show an additional large-text question allowing them to elaborate.
What I'm struggling with is how to set up the condition for this field. I can of course do (pseudocode): "if rank1 == other || rank2 == other || rank3" but that gets old fast if you have a lot of options. Is there a way to simply do something like: "q1.selectedOptions.contains(other)" ?
I can't find anything like this in the manual.
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
1 year 5 months ago #233522
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Show question when a specific option is one of the selected items in a ranked q
You only have to count the appearance of "Other" and display the question if the count is greater than 0.
Use function "countif" like
countif("98",that.Q1)
with
98 = code of "Other"
Q1: Code of rank question
Use function "countif" like
countif("98",that.Q1)
with
98 = code of "Other"
Q1: Code of rank question
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- Aaargh
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
1 year 5 months ago #233631
by Aaargh
Replied by Aaargh on topic Show question when a specific option is one of the selected items in a ranked q
Thanks. That works.
Please Log in to join the conversation.