- Posts: 18
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Array Filter Exclusion for two questions without the exact same answer options
- JasonZA
- Topic Author
- Offline
- New Member
Your LimeSurvey version: 5.6.36+230830
Own server or LimeSurvey hosting: Own server
Survey theme/template:
==================
Good day. I have a list (radio) question where the respondent can select the biggest challenge and the next question, which is also a list (radio) question where the respondent can select the biggest strength. I have added the table below for reference. What I require is an Array filter exclusion for only answers shown in the biggest challenge question and the biggest strength question that are the same. The answer options are not the same for both questions but there are some, which I'd like an array filter exclusion added to. Is this possible. Any assistance will be much appreciated.
Kind Regards,
Jason
Please Log in to join the conversation.
- JasonZA
- Topic Author
- Offline
- New Member
- Posts: 18
- Thank you received: 0
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Remove rows
$('#javatbd{SGQ}1').remove();
$('#javatbd{SGQ}8').remove();
$('#javatbd{SGQ}14').remove();
// Fix up the row classes
var rowClass = 1;
$('#question{QID} table.subquestions-list tbody tr').each(function(i) {
if($(this).hasClass('sub-header-row')) {
rowClass = 1
}
else {
rowClass++;
$(this).removeClass('array1 array2')
if(rowClass % 2 == 0) {
$(this).addClass('array2');
}
else {
$(this).addClass('array1');
}
}
});
});
</script>
Kind Regards,
Jason
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
- Posts: 13060
- Thank you received: 4021
Sorry, I do not understand.which is also a list (radio) question where the respondent can select the biggest strength. I have added the table below for reference. What I require is an Array filter exclusion for only answers shown in the biggest challenge question and the biggest strength question that are the same.
You have two list(radio) questions (Q1 and Q2)
And now you want to display in Q3 what?
All answer options that are in Q1 as well as in Q2, but are not selected in Q1 or Q2?
This is my understanding of it.
Well, this is the same approach I showed in your last question.
You only have to adapt the equation.
Like
{HM3_2=if(Q1==2 or Q2==2,"","Y")}
{HM3_4=if(Q1==4 or Q2==4,"","Y")}
...
Again the array filter of Q3 set on HM.
Of course you can do it viceversa and set the array exclusion filter.
What is missing in this my example is the handling of "other" and "none"
Better you send the lss export.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- JasonZA
- Topic Author
- Offline
- New Member
- Posts: 18
- Thank you received: 0
If an answer option in Q15 is selected, it must not be shown in Q16 (Array Exclusion) but I need to hide specific answer options in Q15 that are not applicable to Q15 and some in Q16 that are not applicable in Q16.
i.e. hide answer option CC, FF, GG and NN in Q15 and hide answer option AA, HH and OO in Q16.
For some odd reason when I try adding Q15 as the Array filter exclusion for Q16, it throws some PHP error but my main concern at present is hiding the answer options for Q15 and Q16.
I have attached the lss file.
Kind Regards,
Jason
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
- Posts: 13060
- Thank you received: 4021
Okay.If an answer option in Q15 is selected, it must not be shown in Q16 (Array Exclusion)
So, why do you display these answer options?but I need to hide specific answer options in Q15 that are not applicable to Q15 and some in Q16 that are not applicable in Q16.
It is the same as before.
Set the hidden multiple like
{HM_2=if(Q15==2,"Y","")}
{HM_3=if(Q15=,"Y","")} as Q15 never will be equal 3, you could remove this.
{HM_4=if(Q15==4,"Y","")}
{HM_5=if(Q15==5,"Y","")}
{HM_7=if(Q15==7,"Y","")} as Q15 never will be equal 7, you could remove this.
{HM_9=if(Q15==9,"Y","")}
...
And use it as array exclusion filter.
Joffm
Read the manual (again):For some odd reason when I try adding Q15 as the Array filter exclusion for Q16, it throws some PHP error but my main concern at present is hiding the answer options for Q15 and Q16.
[url] manual.limesurvey.org/Question_type_-_Ar...r_.28array_filter.29 [/url]
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- JasonZA
- Topic Author
- Offline
- New Member
- Posts: 18
- Thank you received: 0
Please Log in to join the conversation.