- Posts: 8
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to add condition on previous question type array (numeric) with checkbox?
- laura.bonacini
- Topic Author
- Offline
- New Member
Less
More
1 year 10 months ago #229695
by laura.bonacini
How to add condition on previous question type array (numeric) with checkbox? was created by laura.bonacini
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 3.22.24+200630
Own server or LimeSurvey hosting: DK
Survey theme/template: fruity / Inherit
==================
Hello
I am creating a survey on LimeSurvey and I am a bit stuck with a specific conditionality.
I have a first Question (F3) "What are the reasons you use the .csv file download function?" with an array (numeric) question type and checkbox instead of numbers entry; where x are the different reason(s)+other reason(s) and y different register names.
I have a second question (i3) "Please specify the other reason(s):" that should appear only for register names where "other reason(s)" were selected.
To do so, I have wrote conditions in the relevant equation (((F3_A1_SQ005.NAOK == "Y")) or ((F3_A2_SQ005.NAOK == "Y")) or ((F3_A3_SQ005.NAOK == "Y"))) and also on subquestion relevance for each y values. Regiter names are coded as "A1" "A2" "A3" and "other reason(s)" is coded as "SQ005".
But this conditionnality isn't working this way.
Do you know how I could fix this ?
Do you think the problem comes from a miswritten relevance equation ? I am not sure what value takes a column when checked. I tried "Y" "Yes" "true" "1" "on" but nothing of those value work
Or is the problem linked to the type of question F3?
Thank you in advance for your feedback.
Laura
Your LimeSurvey version: Version 3.22.24+200630
Own server or LimeSurvey hosting: DK
Survey theme/template: fruity / Inherit
==================
Hello
I am creating a survey on LimeSurvey and I am a bit stuck with a specific conditionality.
I have a first Question (F3) "What are the reasons you use the .csv file download function?" with an array (numeric) question type and checkbox instead of numbers entry; where x are the different reason(s)+other reason(s) and y different register names.
I have a second question (i3) "Please specify the other reason(s):" that should appear only for register names where "other reason(s)" were selected.
To do so, I have wrote conditions in the relevant equation (((F3_A1_SQ005.NAOK == "Y")) or ((F3_A2_SQ005.NAOK == "Y")) or ((F3_A3_SQ005.NAOK == "Y"))) and also on subquestion relevance for each y values. Regiter names are coded as "A1" "A2" "A3" and "other reason(s)" is coded as "SQ005".
But this conditionnality isn't working this way.
Do you know how I could fix this ?
Do you think the problem comes from a miswritten relevance equation ? I am not sure what value takes a column when checked. I tried "Y" "Yes" "true" "1" "on" but nothing of those value work
Or is the problem linked to the type of question F3?
Thank you in advance for your feedback.
Laura
Attachments:
Please Log in to join the conversation.
- holch
- Away
- LimeSurvey Community Team
Less
More
- Posts: 11645
- Thank you received: 2738
1 year 10 months ago #229698
by holch
The problem most probably is the order of subquestion code and answer option code. Afaik the subquestion code comes first, then the answer code.
Try:
It is always good to check what the output of a code is to see if the code was written correctly.
Just put {F3_SQ005_A1.NAOK} into a question text and see what the output is if you tick this box. Also, if the variable doesn't exist, Limesurvey will usually tell you that the variable is undefined.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic How to add condition on previous question type array (numeric) with checkbox?
Code:
F3_A1_SQ005.NAOK == "Y"
The problem most probably is the order of subquestion code and answer option code. Afaik the subquestion code comes first, then the answer code.
Try:
Code:
F3_SQ005_A1.NAOK == "Y"
It is always good to check what the output of a code is to see if the code was written correctly.
Just put {F3_SQ005_A1.NAOK} into a question text and see what the output is if you tick this box. Also, if the variable doesn't exist, Limesurvey will usually tell you that the variable is undefined.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: laura.bonacini
Please Log in to join the conversation.
- laura.bonacini
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
1 year 10 months ago #229704
by laura.bonacini
Replied by laura.bonacini on topic How to add condition on previous question type array (numeric) with checkbox?
Hello Holch
Thank you for your quick response.
I've tested F3_SQ005_A1.NAOK == "Y" as suggested in a question text but the inversion gets a red code (see attachment).
My first code was based on this topic: forums.limesurvey.org/forum/installation...option-in-limesurvey
It is possible that the box checked in LimeSurvey isn't coded as "Y" but as something else... but what?
Kind regards
Laura
Thank you for your quick response.
I've tested F3_SQ005_A1.NAOK == "Y" as suggested in a question text but the inversion gets a red code (see attachment).
My first code was based on this topic: forums.limesurvey.org/forum/installation...option-in-limesurvey
It is possible that the box checked in LimeSurvey isn't coded as "Y" but as something else... but what?
Kind regards
Laura
Attachments:
Please Log in to join the conversation.
- holch
- Away
- LimeSurvey Community Team
Less
More
- Posts: 11645
- Thank you received: 2738
1 year 10 months ago #229706
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic How to add condition on previous question type array (numeric) with checkbox?
OK, then your subquestion / answer code naming is a little weird. Anyway, it is difficult to say where the problem could be, without seeing what you have actually done. Screenshots only can show so much.
Provide a LSS export of the survey with only the relevant parts (copy the survey, delete everything that has nothing to do with the described issue, change the question texts if necessary, export it as LSS and upload it here).
This way we can import your survey and see everything for ourselves, and we can also test what works and what doesn't.
Provide a LSS export of the survey with only the relevant parts (copy the survey, delete everything that has nothing to do with the described issue, change the question texts if necessary, export it as LSS and upload it here).
This way we can import your survey and see everything for ourselves, and we can also test what works and what doesn't.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: laura.bonacini
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3970
1 year 10 months ago - 1 year 10 months ago #229708
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to add condition on previous question type array (numeric) with checkbox?
Hi,
it is an Array(Numbers).
So numbers are entered. So you won't expect an alphanumeric character.
The codes of this checkbox layout are
1 = selected
probably blank = not selected
If you are not sure, activate the survey, enter some data and have a look at the answers.
Afterwards you deactivate it again.
In the answer table you see how the question/subquestion code looks like, and how it is coded.
This is how I do it if I am not sure how to access an "other" option or a comment or whatever.
Joffm
it is an Array(Numbers).
So numbers are entered. So you won't expect an alphanumeric character.
The codes of this checkbox layout are
1 = selected
probably blank = not selected
If you are not sure, activate the survey, enter some data and have a look at the answers.
Afterwards you deactivate it again.
In the answer table you see how the question/subquestion code looks like, and how it is coded.
This is how I do it if I am not sure how to access an "other" option or a comment or whatever.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 10 months ago by Joffm.
The following user(s) said Thank You: laura.bonacini
Please Log in to join the conversation.
- laura.bonacini
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
1 year 10 months ago #229710
by laura.bonacini
Replied by laura.bonacini on topic How to add condition on previous question type array (numeric) with checkbox?
Hi Joffm
Perfect, it worked this time with == "1" !!
Thanks a lot
Good evening
Perfect, it worked this time with == "1" !!
Thanks a lot
Good evening
Please Log in to join the conversation.
- holch
- Away
- LimeSurvey Community Team
Less
More
- Posts: 11645
- Thank you received: 2738
1 year 10 months ago #229711
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic How to add condition on previous question type array (numeric) with checkbox?
I had not though of the fact that the Array (Numbers) of course can only have numbers!
But with the tip of displaying the code in a question first would have brought that issue up. If you expect a "Y" and see a "1" you should be alerted.
But with the tip of displaying the code in a question first would have brought that issue up. If you expect a "Y" and see a "1" you should be alerted.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.