Professional > Interview scripting > Quota control > Keeping track of quotas > Keeping track of quotas
 
Keeping track of quotas
While interviewing is in progress, UNICOM Intelligence Interviewer - Server maintains three counts for each cell. The main one is the count of completed interviews in that cell--for example, the number of completed interviews with women or the number of completed interviews with people aged 18 to 24. If the number of completed interviews matches the target for that cell, the interview fails the quota and will be terminated.
The second count, known as the pending count, is the number of interviews currently in progress in a cell. When the interviewing program reaches a quota testing statement in the script, it checks which quota cells the respondent belongs to and, if the quotas have not been met, increments the pending counts for those cells by 1. If the interview later completes successfully (that is, is not stopped or does not time out), UNICOM Intelligence Interviewer - Server decrements the pending counts by one and increments the corresponding completed counts by one.
If the interview belongs to cells whose targets have all been met, the interview fails quota control and is terminated.
If you are testing more than one quota at a time, and a respondent passes one quota and fails another, the pending counts for the unfilled cells will be temporarily incremented by 1, and all counts for the full cells will remain untouched.
Interviews of this type are usually terminated by quota control, although you can choose to flag them as completed interviews by routing to the end of the script or by terminating them with a sigCompleted or sigEarlyComplete status. If you terminate the interview by quota control, the relevant pending counts are decremented by 1, and the corresponding rollback counts are incremented. The corresponding completed counts remain unchanged. If you treat the interview as a successful completion, the pending counts are decremented and the completed counts are incremented for the quotas that did not fail. The counts for the quotas that were full remain unchanged.
Pending counts are incremented once per respondent, regardless of the number of times the quotas are tested. If a respondent snaps back during an interview causing a quota test to be re-executed, the pending counts are not incremented when the test is executed the second time.
The third count stored in the cell is the rollback count. This counts the number of times the pending counts have been rolled back to exclude interviews that have timed out, or that have been stopped, or that have been terminated because the interview failed another quota that appears later in the script. While the interview is running, the pending counts for the unfilled cells that the respondent belongs to are incremented by 1. When the interview ends in an abnormal way, those pending counts are decremented by 1 and the corresponding rollback counts are incremented by 1. The interviews are not completed so the completed counts remain unchanged.
The following example illustrates how the pending and rollback counts are maintained. The metadata section of the script is:
Region "Where do you live?" categorical [1..1]
{North, South, East, West};
FailRegion "We have enough people who live in the {#Region}" info;
Gender "Are you ...?" categorical [1..1]
{Male, Female};
The routing section is:
Dim quota_pend_result
Region.Ask()
quota_pend_result = QuotaEngine.QuotaGroups["RegionQuota"].Pend()

If Not (IsSet(quota_pend_result,   QuotaResultConstants.qrWasPended)) Then
  FailRegion.Show()
  IOM.Terminate(Signals.sigOverQuota)
End If

Gender.Ask()
quota_pend_result = QuotaEngine.QuotaGroups["GenderQuota"].Pend()

If Not (IsSet(quota_pend_result,   QuotaResultConstants.qrWasPended)) Then
  IOM.Terminate(Signals.sigOverQuota)
End If
After a period of interviewing the pending, completed and rollback counts are as follows. Notice that the target for women has been met so any subsequent interviews with women will be terminated.
Quota cell
Target
Pending
Completed
Rollback
North
25
0
22
0
South
25
0
23
0
East
25
0
19
0
West
25
0
23
0
Male
50
0
37
0
Female
50
0
50
0
The next interview is for a woman in the East. After the respondent has answered the region question, the cell counts are as follows:
Quota cell
Target
Pending
Completed
Rollback
North
25
0
22
0
South
25
0
23
0
East
25
1
19
0
West
25
0
23
0
Male
50
0
37
0
Female
50
0
50
0
Another interview starts, this time for a man in the East. When he has answered the region question, but before either respondent answers the gender question, the cell counts are as follows:
Quota cell
Target
Pending
Completed
Rollback
North
25
0
22
0
South
25
0
23
0
East
25
2
19
0
West
25
0
23
0
Male
50
0
37
0
Female
50
0
50
0
When the female respondent fails the gender quota, nothing happens to the gender counts, but the pending count for the East quota is decremented by 1 and the rollback counter for that cell in incremented by 1. The table of cell counts at the end of the woman's interview is as follows:
Quota cell
Target
Pending
Completed
Rollback
North
25
0
22
0
South
25
0
23
0
East
25
1
19
1
West
25
0
23
0
Male
50
0
37
0
Female
50
0
50
0
When the male respondent finishes his interview, the pending count for East is decremented by 1 and the completed count is incremented by 1. The completed count for Male is also incremented:
Quota cell
Target
Pending
Completed
Rollback
North
25
0
22
0
South
25
0
23
0
East
25
0
20
1
West
25
0
23
0
Male
50
0
38
0
Female
50
0
50
0
See also
How the quota system works