Have an idea?

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

Counting Answers


I have a grid question with 18 brand in row and 4 response in column (A,B,C,D), i need to set a filter if less that 3 choose either A or B in the column list then this will skip to question named disqulaifed

Knowing that from brand 12 to 18 the answer will be treated as one

for example

Brand 1-->A
Brand 2-->C
Brand 3-->C
Brand 4-->C
Brand 5-->C
Brand 6-->C
Brand 7-->C
Brand 8-->C
Brand 9-->C
Brand 10-->C
Brand 11-->C
Brand 12-->A
Brand 13-->B
Brand 14-->A
Brand 15-->A
Brand 16-->A
Brand 17-->A
Brand 18-->A

The above example the count should be only 2 as from brand 12 to brand 18 it will be treated as one brand
asked Aug 31, 2018 by Ossama

1 Answer

+1 vote
I would just create a constructed list.  Assuming that B is the 2nd item in your list you could just use AIE (QQ, 2)  Where QQ would be your grid question name.  This will add all Brands that gave a 2.  Now set your skip using the ListLength of this constructed list.  So if the constructed list was called BBrands.  Your skip logic would be ListLength (BBrands) < 3 and skip to disqualified.  Make it a post skip on that grid question.
answered Aug 31, 2018 by Jay Rutherford Gold (31,740 points)
Thanks but this is will not work for the following,
First we need to count A and B not only B
Second from Brand 12 to 18 if all of them answered as B so the count will be 7 where the count should be only 1
Not a problem  construct your list as follows.  You could accomplish this with some javascript, or using a couple of constructed lists.  Let's assume your grid row list is called QQRowList.  You will use that as the Parent list for your two constructed lists.
First create a constructed list BBrandOther:

This will give you a list of all items 12-18 that chose A or B at your grid question (QQ).

Then create a constructed list BBrand:
Begin Unverified Perl
End Unverified

This will create a list of all items 1-11 if they chose A or B at your grid question (QQ).  Then the perl code will add just item 12 if BBrandOther has any items in it (which would be any 12-18 that chose A or B).