Home > FAQ, Survey Creation > How To: Filter Answers By Answers

How To: Filter Answers By Answers

Overview

The following steps will introduce you to the ‘Filter Answer by Answers’ method which is built within our function libraries.

Using this function, you can filter a questions answers according to an-other question’s answers, making the questions answers adjust according to your needs.
For example, let’s say we have the following ‘Multi-Selection’ questions with the same scale of answers:

1. ‘Which of the following brands are familiar to you?’

2. ‘Which of the following brands did you purchase in the past year?’

3. ‘Which of the following brands did you purchase in the last month?’

We will need that answers which were not chosen in question 1 will not appear in question 2.
Answers which were not chosen in question 1 and question 2 will not appear in question 3.

Filtering Answers By Answers:
Let’s create a few multi-selection questions:

Just for this example, we can use the same answer scale in all of them:

Now we can choose the answers and configure them to be the only ones that will show on the next question:

By adding the following start script to the question we want to filter its answers:

FilterAnswersByAnswers(39, QRef(38));

The function will filter question 39’s answers by the answers that were chosen in question 38:

If we want to do the opposite – show answers that were NOT chosen, we can add the following start script to the question we want to filter its answers:

FilterAnswersByAnswers(39, false, QRef(38));

*Notice: Changing the value from false to true is the same like the default function we saw previously.

For example, the answers that are chosen in question 38:

Will be hidden in question 39:

That’s it! This is an introduction of how to use ‘Filter Answers By Answers’ function!

Visit us at: http://www.dooblo.net

Categories: FAQ, Survey Creation
  1. Greg Streatfield
    June 15, 2012 at 11:10 am

    How do you combine a showing the answers from one question BUT not the asnwers froma subsequent section? So essentailly i need to use a combination of the above both.

    • June 15, 2012 at 11:32 am

      You can use 2 filter function calls one after the other, and make sure to use the “not reset” flag on the second call so the second call won’t reset the filtering of the previous call. Example: the following start script code in Q5 will show the answers of Q3 and hide the ones selected in Q4:
      FilterAnswersByAnswers(CurrQues,QRef(3));
      FilterAnswersByAnswers(CurrQues,false,false,QRef(4));

      Note that in the second call to the filter function, the first “false” instructs the function to hide the answers of Q4, while the second “false” instructs the function to not reset the answers of the question so that it will apply this filter ON TOP of the previous filter.

  2. Csarmasz, Máté
    October 29, 2012 at 8:33 am

    How do I make sure that some answers (such as “None of these”, “Don’t know / Refused”, “Other please specify:”) are not filtered out?

  3. Dan
    January 1, 2013 at 6:58 am

    Hi there, How do you set an answer is still available while it is not chosen from the previous question. For example, i have Q1(A, B,C, D … , None) chosen A, B, C. So i want to display None also A,B,C in Q2.

  4. April 24, 2013 at 8:38 am

    How to filter answers for CurrQues based on combined answers from CurrQues-1 and CurrQues-2?

    • April 24, 2013 at 9:25 am

      I got the answer:-
      FilterAnswersByAnswers(CurrQues,QRef(CurrQues-1),QRef(CurrQues-2))
      Thanks

  5. danieldooblo
    April 24, 2013 at 8:48 am

    You can use 2 filter function calls one after the other, and make sure to use the “not reset” flag on the second call so the second call won’t reset the filtering of the previous call.
    Example: the following start script code in CurrQues will show the answers of CurrQues-1 and CurrQues-2:
    FilterAnswersByAnswers(CurrQues,CurrQues-1);
    FilterAnswersByAnswers(CurrQues,true,false,CurrQues-2);
    Note that in the second call to the filter function, the “true” instructs the function to show the answers of CurrQues-2, while the second “false” instructs the function to not reset the answers of the question so that it will apply this filter ON TOP of the previous filter.

  6. May 30, 2013 at 11:53 am

    Hi, What if I want to put a filter by Answers but have a “None of these” included also?
    Script like that:
    FilterAnswersByAnswers(CurrQues,true,CurrQues-1)
    SetAnswerVisible(CurrQues,31,true)
    does not show answer 31

    • July 7, 2013 at 7:41 am

      Hi Mikhail,
      The script you wrote above should work and set answer #31 to visible.

  7. May 30, 2013 at 12:02 pm

    Hi, sorry, now it works:) I will check other similar questions and let you know, if anything goes wrong

  8. September 1, 2014 at 3:04 am

    My survey questions are as below:-
    ==============================================================
    D3. How many children (below 18 years old) do you have in your household?
    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    10. 10 or more

    D4. How many people are currently living in your household?
    [INTERVIEWER TO MAKE SURE RESPONSE IS NOT LESS THAN D3]
    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    10. 10 or more
    =============================================================
    How do I filter options in D4 based on D3 answer? Please help. Thanks

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: