Preparing the Quota XML
Because the Saturday and Sunday responses were selected for the HomeDay question, the quota with the expression HomeDay.HasAnswer({Saturday}) and HomeDay.HasAnswer({Sunday}) must be updated. The quota with the expression Age >= 18 must be increased because the complete count was increased by one, and the question Age was set to 30. In addition, the QuotaHistory table must be appended for quota cells changes. The table includes the following fields:
Quota XML fields
RespondentID
The case data respondent ID.
InterviewerID
The interviewer ID.
PendResult
The quota pend result.
TimeStamp
The time stamp that records when the update occurred.
Result
The resulting Quota XML is as follows:
Note The Expression section is not required when sending a quota update. The QuotaCell and QuotaCell.QuotaHistory sections are required. The Expression section is required when executing the quota pend on the client.
<Quota>
<QuotaCell QuotaID="1" Name="Top.(0.HomeDay).(0.Monday)" MatrixName="HomeDay" MatrixID="1" Metadata="" PendMode="Normal" PendLimit="-1" Target="5" PendCount="0" CompleteCount="0" PreviousCompleteCount="0" RollbackCount="0">
<Expression>
<Text>HomeDay.HasAnswer({Monday})</Text>
<Opcodes>
<Opcode Code="PushCategorical">
<Operand>Monday</Operand>
</Opcode>
<Opcode Code="Function">
<Operand>HasAnswer</Operand>
<Operand>1</Operand>
<Operand>HomeDay</Operand>
</Opcode>
</Opcodes>
</Expression>
</QuotaCell>
(Other similar QuotaCells removed for brevity)
<QuotaCell QuotaID="6" Name="Top.(0.HomeDay).(5.Saturday)" MatrixName="HomeDay" MatrixID="1" Metadata="" PendMode="Normal" PendLimit="-1" Target="5" PendCount="0" CompleteCount="1" PreviousCompleteCount="0" RollbackCount="0">
<Expression>
<Text>HomeDay.HasAnswer({Saturday})</Text>
<Opcodes>
<Opcode Code="PushCategorical">
<Operand>Saturday</Operand>
</Opcode>
<Opcode Code="Function">
<Operand>HasAnswer</Operand>
<Operand>1</Operand>
<Operand>HomeDay</Operand>
</Opcode>
</Opcodes>
</Expression>
<QuotaHistory RespondentID="ID1" InterviewerID="user" PendResult="2048" TimeStamp="2014-10-31T02:00:29Z"/>
</QuotaCell>
<QuotaCell QuotaID="7" Name="Top.(0.HomeDay).(6.Sunday)" MatrixName="HomeDay" MatrixID="1" Metadata="" PendMode="Normal" PendLimit="-1" Target="5" PendCount="0" CompleteCount="1" PreviousCompleteCount="0" RollbackCount="0">
<Expression>
<Text>HomeDay.HasAnswer({Sunday})</Text>
<Opcodes>
<Opcode Code="PushCategorical">
<Operand>Sunday</Operand>
</Opcode>
<Opcode Code="Function">
<Operand>HasAnswer</Operand>
<Operand>1</Operand>
<Operand>HomeDay</Operand>
</Opcode>
</Opcodes>
</Expression>
<QuotaHistory RespondentID="ID1" InterviewerID="user" PendResult="2048" TimeStamp="2014-10-31T02:00:29Z"/>
</QuotaCell>
<QuotaCell QuotaID="8" Name="Quota_1" MatrixName="Expressions" MatrixID="2" Metadata="" PendMode="Normal" PendLimit="-1" Target="10" PendCount="0" CompleteCount="0" PreviousCompleteCount="0" RollbackCount="0">
<Expression>
<Text> Age < 18</Text>
<Opcodes>
<Opcode Code="PushIdentifier">
<Operand>Age</Operand>
</Opcode>
<Opcode Code="PushNumberic">
<Operand>18</Operand>
</Opcode>
<Opcode Code="CmpLess"/>
</Opcodes>
</Expression>
</QuotaCell>
</Quota>
Next
See also