Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Programming a routing based on selected values greater than 3 into multiple follow-up questions

Hi all,

I'm struggling with the following programming situation:

First question should be:
Q1 (Familiarity): "How familiar are you with these car brands?"

 The respondent can select from 1 (not familiar) to 5 (very familiar) (columns) for each alternative (rows):

                           1     2    3   4    5
Car brand1  |     |     |  X |     |     |
Car brand 2 |     |     |     |  X |     |
Car brand 3 |     |     |     |     |  X |

Based on these results, respondents who answered with a value higher than 3 should be routed into follow-up questions concerning the just evaluated car brands. E.g.:

Q2 (attractiveness): Please rate the following components of [car brand with familiarity >3]?

Every respondent should be routed to ALL follow-up Questions.
The answer options of question 2 differ regarding to the car brand

In our example above (CarBrand1 = 3; CarBrand2 = 4; CarBrand3 = 5) the respondent should be displayed the next questions for CarBrand2 and CarBrand3 but not for CarBrand1.

If a respondent evaluates none of the alternatives with a value higher than 3, he should not be displayed  any further questions on this topic.

How do I program this?

I'm happy for any helping advice. Thanks!
asked Oct 24, 2019 by Raphael

2 Answers

0 votes
Let's start by going into the List Manager and creating a new constructed list.  The constructed list's parent should be the list of car brands and its instructions should be this:

Begin Unverified Perl
# Parameters
my $plist = 'list1';
my $gridQ = 'Q1';

# Run
my $len = LISTLENGTH($plist);
for (my $item = 1; $item <= $len; $item++) {
    if (GETVALUE($gridQ . '_r' . $item) > 3) {
        ADD($plist, $item);
End Unverified

"list1" must be replaced with the name of the predefined list of car brands; "Q1" must be replaced with the name of the grid question.

Now, in the Write Questionnaire window, go into Randomize and add a random block.  Set the new randomized set to use our constructed list from before.  Finally, you can define each block of the randomized set so each row lines up with the follow-up question(s) for that particular car brand (e.g., if Q2 is the follow-up question for the first brand, then the anchor questions in the first row should both be set to Q2).
answered Oct 24, 2019 by Zachary Platinum Sawtooth Software, Inc. (212,550 points)
0 votes
It sounds like you want to create a constructed list and then use a loop for the follow up questions.  So, since Q1 is a grid you can use AIG in your constructed list.  I'll assume your car brands are in the list Q1RowList.  Create a constructed list (I'll call it BrandFamiliar) using Q1RowList as the parent list.  The instruction for the list build will just be AIG (Q1,3).  This will add all row items from Q1 that rated a 4 or 5.

Now, we'll assume the only follow up is Q2.  You would click on the Looping button in the Write Questionnaire section of your survey in Lighthouse.  Add a new loop (I'll call it BrandLoop) and select the list you just made (BrandFamiliar) and make Q2 the anchor question1 and anchor question2.  If you had more follow up questions (say Q2-Q4) then the last question would be anchor question2.

Your question text for Q2 would look like this:

Q2 (attractiveness): Please rate the following components of [% LoopLabel() %]?  That will insert the label for the current item in your loop list.  This will all work fine if the follow up questions and lists are the same for all brands.

Since you mentioned that the Q2 List would differ by brand you will need to create a constructed list for Q2.  Start with a Predefined List (I'll call it Q2Base).  Now create Q2List as a constructed list using Q2Base as the Parent List as my example below shows for 2 different brands.  If the current loopvalue is for brand 1 then I am adding items 1-5 from the Parent list.  If the current loopvalue is for brand 2, then I am adding items 1-3 and 7-10.  You can continue that script for as many items (brands) as you have with the appropriate items showing in Q2.  This should get you on your way for what you are looking to do.  Let me know how it goes and if you run into any problems.

Begin Unverified Perl
End Unverified
answered Oct 24, 2019 by Jay Rutherford Platinum (52,045 points)