Scroll

Least fill quota routing on multi-coded questions

Least fill quota routing on multi-coded questions

Follow
Summary This document provides examples and explanations of how to create least fill routing set-ups. Both standard multi-coded questions and multi-coded questions in a loop are discussed.
Applies to Askia Design
Written for Scripters and Survey Designers
Keywords Design, least fill, quota, scripts 1.0, scripts 2.0, multi, routing

Table of contents:


Least fill quota routing for a multi-coded question

Many of you will be familiar with least fill routing i.e. checking quotas and using their values to determine questions to be asked of a respondent.

Below is a basic example of how we would do this for a multi-coded question:

In 5.4.X versions (quota on multiple questions allowed):

In 5.3.X versions:

The survey can be tested here. As you can see, with 5.4.X. Versions of Design and CCA, the structure and routing logic required is greatly simplified compared to 5.3.X, particularly the fact that we can deal directly with multiple questions without having to split them up into individual variables per response.

Task packages can be imported as shown below. This will allow you to import the task and quotas in one go and test the survey as live.

 


 

Least fill quota routing for a multi-coded question inside a loop

 

In 5.4.X versions (quota on multiple questions allowed):

The routing below returns into variable top3 the items, per brand, that have the three highest quota to do counts

In 5.3.X versions:

The routing below returns into variable top3 the items, per brand, that have the three highest quota to do counts

* line 11 in the routing above is the only difference required between 5.3.X and 5.4.X because we deal with a multiple rather than several single coded questions with one response.

The first eight lines merely define variables that we will use further on in our code

The section of code below populates arr with the quota to do values of all 5 items in s1.

For i = 1 to intNbResponse
            arr.insert(QuotaToDo("item" + (intStep + i) + ":" + 1))
Next 

The following code reorders arr from the most quota to do to the least quota to do and sets it into arrOrdered

For j = 1 to intNbResponse
            arrOrdered = arrOrdered + arr.IndexOfMax(j)
Next j 

Here, the code selects the 3 highest quota to do values from those items selected in s1 and sets them into arrMax3

For k = 1 to 3
            arrMax3 = arrMax3 + (arrOrdered intersection s1)[k]
Next k

‘For k = 1 to 3’ can easily be changed to select the top 1, 2, 4, 5, 100.. etc

Finally, here we return the result we want to set into our top3 variable in the survey

Return arrMax3

itemloop is then linked on all selected responses to top3.

Here the respondent is in a loop of up to five items selected at s1 and also in a loop of three brands.

You can use their responses at this stage to update the quotas for items by brand before they exit the interview. See routings setting value into variables item1 to item15. If they have code 1 at least fill item they will increment the quota by 1.

You can test the example survey here.

 

 

 

Have more questions? Submit a request

Comments

  • Avatar
    Ashok Nagaraj

    Instead of single punch question can we use the Multi punch question in the questions for least fill.

    Because if we have 50 brands out of that we are choosing only 4 means, we are now creating the 50 single punch questions for each brands.
    This makes little more time consuming and large effort, instead if we have the Multi punch question that accept the Quota in superior and use the same for least fill brand picking.

    Please let me know is this correct or any other suggestions if there.

  • Avatar
    Seyf Altindal

    Hi Ashok,

    The functionality to quota on multi-coded variables is under development. It will be available in Supervisor versions 5.4.X onwards.

    Edited by Seyf Altindal
  • Avatar
    Ashok Nagaraj

    Thanks for update Seyf.