Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
en:create:filter-itemcount [19.11.2014 13:48] – alexander.ritter | en:create:filter-itemcount [28.11.2014 13:31] – [Loops und Filters] alexander.ritter |
---|
====== At Least One Item Selected ====== | ====== At Least One Item Selected ====== |
| |
It is sometimes not enough to check individual answers for a filter; all the items in a question have to be looked at. Whether it be to look up corresponding items in another question ([[filter-items|Use Selected Items in Another Question]]) or just to check whether at least one item fulfills a particular condition. An exception to this is the calculation of scale indices within the survey ([[points|Count Points for Answers]]). | Sometimes, it is not sufficient for a filter to check individual answers; but rather all the items in a question have to be looked at. Whether it be to look up corresponding items in another question ([[filter-items|Use Selected Items in Another Question]]) or just to check whether at least one item fulfils a particular condition. An exception to this is the calculation of scale indices within the survey ([[points|Count Points for Answers]]). |
| |
This chapter describes the function ''getItems()'' and so-called loops -- two tools which allow sophisticated filters over multiple items. The starting point of this chapter is the following question TF04: a scale. The scale's values and the item IDs are shown in the image for additional information. | This chapter describes the function ''getItems()'' and so-called loops -- two tools which allow sophisticated filters over multiple items. The starting point of this chapter is the following question TF04: a scale. The scale's values and the item IDs are shown in the image for additional information. |
</code> | </code> |
| |
**Tip:** If the item ID is only stated as a single-digit ((''TF04_1'' instead of ''TF04_01''), ''value()'' command is not affected. This is particularly useful if the user wants to check more than 9 items. | **Tip:** If the item ID is only stated as a single-digit ((''TF04_1'' instead of ''TF04_01''), the ''value()'' command is not affected. This is particularly useful if the user wants to check more than 9 items. |
| |
In this example, it is particularly interesting what can be done with the counter (''$counter'') -- i.e. the last three lines. If an interview uses none of the specified media at least once a month, in the above example he will be sent directly to the end of the questionnaire. Of course, a question block could also be skipped in this way or other filters implemented depending on ''$counter''. | In this example, it is particularly interesting what can be done with the counter (''$counter'') -- i.e. the last three lines. If an interview uses none of the specified media at least once a month, in the above example he will be sent directly to the end of the questionnaire. Of course, a question block could also be skipped in this way or other filters implemented depending on ''$counter''. |
**Tip:** If you need the complex determined variable ''$counter'' later on in the questionnaire for another filter, use the function ''[[functions-proc#registervariable|registerVariable()]]''. | **Tip:** If you need the complex determined variable ''$counter'' later on in the questionnaire for another filter, use the function ''[[functions-proc#registervariable|registerVariable()]]''. |
| |
It is often the case, that only the items for the media used as well should be requested in another question. This process is explained in the chapter [[filter-items|Use Selected Items in Another Question]]. | It is often the case that only items for the media also used should be used in another question. This process is explained in the chapter [[filter-items|Use Selected Items in Another Question]]. |
| |