Have an idea?

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

Pre-skip by answers in a previous question


In Q16, I have a list of 16 products made by 3 different manufacturers. Respondents  ask asked to choose which they use (multi-select).

Products 1, 2, 3 are Manufacturer A
Products 4 through 10 are Manufacturer B
Products 11 through 14 Manufacturer C
15 is other specify and 16 is none of the above.

I want to subsequently ask in Q19 "Who is your favorite manufacturer?", but only those who are using products from more than one manufacturer. I imagine there's a way to do this easily, however I'm not sure how. Please help!
asked Sep 27, 2022 by Rick (310 points)

1 Answer

0 votes
There are probably a few ways to achieve this, but a constructed list with some unverified Perl is what comes to mind.  If you haven't already, create a predefined list with the three manufacturers.  Then create a constructed list that has that list as its parent and give it this logic:

Begin Unverified Perl
# Settings
my $selectQ = 'Q1';

# Run
for (my $i = 1; $i <= 3; $i++) {
    if (GETVALUE($selectQ . '_' . $i)) {
for (my $i = 4; $i <= 10; $i++) {
    if (GETVALUE($selectQ . '_' . $i)) {
for (my $i = 11; $i <= 14; $i++) {
    if (GETVALUE($selectQ . '_' . $i)) {
End Unverified

"Q1" should be replaced with the name of the checkbox select question.

Now you can use this constructed list in your question about favorite manufacturer.  The software should automatically skip the question if fewer than 2 manufacturers are chosen.
answered Sep 27, 2022 by Zachary Platinum Sawtooth Software, Inc. (214,575 points)
Sorry, maybe I should have been more clear because I don't know that this will work for my needs (possibly I don't understand fully).

I also want to ask certain questions to those with only one manufacturer (i.e., pre-skip those with multiple). Is there a way create something that would work in the skip logic section? To be clear, these questions would have different response options than the manufacturers they use today from the previous checkbox select question.
You can use ListLength(ConList)=1 or ListLength(ConList)>1 in your skip logic, based on the number of manufacturers captured within the constructed list Zachary kindly provided. Change "ConList" to the name of your constructed list.