Scoring statements for only 3 brands out of maximum of 5 based on logic

The Challenge
In this case, there are 5 different brands that are tested. Out of the 5, there are only 3 that are relevant and for each responded (based on some logic) and for each of those 3 brands a score of 1-5 should be given for a number of statements. Here’s the original table and instructions:


All statements need to be scored for brand AA, in addition, based on the respondents answers, the statements need to be scored for any two other brands (BB,CC,DD,EE). Up to 3 max brands will be scored and a minimum of 2.

The Solution

We decided to solve this by add a Single choice grid question for each of the statements, and have the brands act as topic. Then it is a matter of adding the correct start script to filter out and leave only the relevant 2 or 3 brands. To assist in getting the correct 2 or 3 brands based on logic, we made use of a dummy question technique. Here is what we did:

  1. Add a Single Choice Grid (previously known as MultiTopic) question for each one of the statements. The question text was according to the above, the answers were 1-5 and the topics were the 5 brands:Notice the answers and “Table layout” rendering – we chose this to make the grid show up nicer:

    And finally, the topics are the actual brands:
  2. It was now time to add the relevant script in the start script of the question, the script needs to do 2 things:
    1. Pipe the correct text to the question text (based on the brands that are shown)
    2. Show only the 2 or 3 relevant brands out of the 5
  3. In order to assist in writing this script, we made use of a dummy question. The dummy question is just a simple non-visible multi select question which has all the brands as answers. We will use the script to set the dummy question answers and to make sure we do not go over the 3 brands limitation. Here is the dummy question we added:To configure it as a hidden (dummy) question, we checked the “Hide from surveyor” property in the advanced tab:
  4. It was now time to add the relevant start script to the grid question that makes use of the dummy question:

dblSetSpecificAnswer (QRef(50), 1, true); // Set Brand AA as checked
if (Contains(16,2) || Contains(18,2) && NumOfSelectedChoices(50) < 3){

// Brand BB needs to be shown

    dblSetSpecificAnswer (QRef(50), 2, true);


if (Contains(16,3) || Contains(18,3) && NumOfSelectedChoices(50) < 3){

// Brand CC needs to be shown

    dblSetSpecificAnswer (QRef(50), 3, true);


if (Contains(16,4) || Contains(18,4) && NumOfSelectedChoices(50) < 3){

// Brand DD needs to be shown

    dblSetSpecificAnswer (QRef(50), 4, true);


if (Contains(16,5) || Contains(18,5) && NumOfSelectedChoices(50) < 3){

// Brand EE needs to be shown

    dblSetSpecificAnswer (QRef(50), 5, true);








Here is how it looks in the start script:

This script

  1. Sets brand AA checked in the dummy question (Q50).
  2. Decides if to set BB,CC,DD and EE checked in the dummy question based on if these brands were selected in Q16 or Q18 and if there are no more than 3 brands already selected.
  3. Finally, it pipes the selected 2 or 3 brands to the question text and sets the topics (brands in this case) visible or hidden based on whether they were a part of the dummy question answers.

The only step left is now to copy and paste the Single Choice grid question and make a copy for every other statement and voila!

Visit us at: