Actions

QS

Array filter exclude: Difference between revisions

From LimeSurvey Manual

mNo edit summary
m (Array (Column) -> Array by column)
 
(14 intermediate revisions by 3 users not shown)
Line 10: Line 10:


<!--T:58-->
<!--T:58-->
The Array filter exclusion advanced setting allows you to use a multiple choice question to select or set which responses '''won't''' display in a subsequent list, array or multiple choice question.
The '''Array filter exclusion''' setting allows you to use any multiple choice question to select or set which responses are '''NOT''' displayed in a subsequent list, array or multiple choice question.


<!--T:59-->
<!--T:59-->
<div class="simplebox">Starting in 1.92, subsequent questions can be filtered on any array question types, including:
<div class="simplebox">The subsequent questions can be filtered on any array question type, including:
*Multiple choice
*Multiple choice
*Multiple choice with comments
*Multiple choice with comments
*Multiple short text
*Multiple short text
*Multiple numeric
*Multiple numeric
*Array (5 point, 10 point, Yes/No/Unknown, Increase/Same/Decrease, Column)
*Array (5 point, 10 point, Yes/No/Unknown, Increase/Same/Decrease, By column)
*Array (Dual Scale, Text, Numbers)
*Array (Dual Scale, Text, Numbers)
*Ranking
*Ranking
Line 26: Line 26:


<!--T:61-->
<!--T:61-->
The only exception is Array (Column), which can filter other questions, but can not itself be filtered.</div>
The only exception is ''Array by column'' which can filter other questions, but it cannot be filtered.</div>


<!--T:62-->
<!--T:62-->
'''To set a filter'''
'''How to set it up'''


<!--T:63-->
<!--T:81-->
Enter the question code of a multiple options question to use as the source information. For example, if your source multiple option question code is "Q1" enter "Q1" into 'Array filter exclusion' input in the '''advanced settings''' of the question you want to filter.
Enter the question code of a multiple options question in the '''array exclusion filter''' box of the question you are currently editing. The respective question will be used as the source of information for the current question, the non-selected answers from the previous question being retrieved and used as answer options for the current question. For example, if your source multiple option question code is "Q1", enter "Q1" into the 'Array exclusion filter' box to start the filtering process of the answers. Only the answer options that are '''NOT''' selected in question Q1 will be visible in your question.


<!--T:64-->
<!--T:64-->
<div class="simplebox">Starting in 1.92, you can enter multiple array_filter_exclude options for a single question, separated by semicolons</div>
<div class="simplebox">If you wish more questions to be filtered via this option, type the question codes in the box separated by semicolons (;).</div>


<!--T:65-->
<!--T:82-->
The source question has to contain exactly the same list of answers/subquestion as the question you wish to filter. Your question will then only display those answers/subquestion that were not selected in the multiple options question.
{{Alert|Title=Attention|text=The subquestion codes used in the first question must coincide with the subquestion codes from the second one. Otherwise, the '''array exclusion filter function''' will not filter the answers to the first question. Check the below example to better understand how the whole system works.}}
 
<!--T:66-->
If the questions do not have exactly the same set of answers/subquestions and codes, then the filters will break.
 
<!--T:67-->
<div class="simplebox">Starting in 1.92, if Q2 has sub-questions that are not present in Q1, they will always be displayed rather than breaking the filters.</div>


<!--T:68-->
<!--T:68-->
Line 50: Line 44:


<!--T:69-->
<!--T:69-->
The Array filter exclusions settings will cascade &ndash; that is you can select a question which filters another question, which filters another question, and so on.
The selected options can be displayed in cascade. This means that you can select a question which filters another question, which filters another question, and so on.


<!--T:70-->
<!--T:70-->
Line 56: Line 50:


<!--T:71-->
<!--T:71-->
Ticking items 'One' and 'Three' in the first question results in those questions not being displayed in the subsequent question which users array filter exclusion
Let's see together the below example:
 
<!--T:72-->
Multi Option Question
 
<!--T:73-->
Code:Q1
 
<!--T:74-->
Question: Which animals do you like?


<!--T:75-->
1 Cat


<!--T:76-->
<!--T:83-->
2 Dog
<center>[[File:Example_array_filter_exclude.png]]</center>


<!--T:77-->
3 Zebra


<!--T:78-->
<!--T:84-->
Array 5 Point Choice Question
In the screenshot from above, we got two questions. The first one is a ''multiple choice'' question type, while the second one is a ''multiple choice with comments'' question type. The answers you provide in the first question will be excluded from the second one. For example, if you select the ComfortUpdate option (that has the subquestion code 'SQ1') and the Plugin option ('SQ4'), the 'SQ1' and the 'SQ4' subquestion correspondents from the second question will be excluded. In our screenshot, we can observe that only the unselected options in the first question and displayed in the second one.


<!--T:79-->
<!--T:85-->
This example can be downloaded from the following link: [[Media:Limesurvey_group_array_filter_exclude.lsg.zip|Limesurvey_group_array_filter_exclude.zip]]. [[Question_groups_-_introduction#Import_a_question_group|Import this question group]] into your LimeSurvey installation.
</onlyinclude>
</onlyinclude>


<!--T:80-->
<!--T:80-->
[[Category:Question Settings]][[Category:Advanced Question Settings]]
[[Category:Question Settings]][[Category:Question Logic Options]]


</translate>
</translate>

Latest revision as of 13:38, 22 April 2018


Array exclusion filter (array_filter_exclude)

Description

The Array filter exclusion setting allows you to use any multiple choice question to select or set which responses are NOT displayed in a subsequent list, array or multiple choice question.

The subsequent questions can be filtered on any array question type, including:
  • Multiple choice
  • Multiple choice with comments
  • Multiple short text
  • Multiple numeric
  • Array (5 point, 10 point, Yes/No/Unknown, Increase/Same/Decrease, By column)
  • Array (Dual Scale, Text, Numbers)
  • Ranking

Furthermore, each of these types of questions can filtered.

The only exception is Array by column which can filter other questions, but it cannot be filtered.

How to set it up

Enter the question code of a multiple options question in the array exclusion filter box of the question you are currently editing. The respective question will be used as the source of information for the current question, the non-selected answers from the previous question being retrieved and used as answer options for the current question. For example, if your source multiple option question code is "Q1", enter "Q1" into the 'Array exclusion filter' box to start the filtering process of the answers. Only the answer options that are NOT selected in question Q1 will be visible in your question.

If you wish more questions to be filtered via this option, type the question codes in the box separated by semicolons (;).
  The subquestion codes used in the first question must coincide with the subquestion codes from the second one. Otherwise, the array exclusion filter function will not filter the answers to the first question. Check the below example to better understand how the whole system works.


Cascading

The selected options can be displayed in cascade. This means that you can select a question which filters another question, which filters another question, and so on.

Example

Let's see together the below example:



In the screenshot from above, we got two questions. The first one is a multiple choice question type, while the second one is a multiple choice with comments question type. The answers you provide in the first question will be excluded from the second one. For example, if you select the ComfortUpdate option (that has the subquestion code 'SQ1') and the Plugin option ('SQ4'), the 'SQ1' and the 'SQ4' subquestion correspondents from the second question will be excluded. In our screenshot, we can observe that only the unselected options in the first question and displayed in the second one.

This example can be downloaded from the following link: Limesurvey_group_array_filter_exclude.zip. Import this question group into your LimeSurvey installation.