Testing that responses total 100%

Problem

You want to make sure that responses to a series of questions total 100% (or whatever other value).

Solution

Use a Test pound instruction as in:

    # Test WhateverName =
      #> [TRIGGER]Q1A
      #> [CONDITION](AQ1A+AQ1B+AQ1C+AQ1D).NE.100
      #> [MESSAGE]
      #> [EN]Please make sure the numbers total 100
      #> [FR]Veuillez vous assurer que le total est 100
      #> [TYPE]TABLE

Discussion

The Test pound instruction can be used to implement any specialised logical test. In the one above, the test is triggered by receiving an answer to question Q1A. The test is then implemented: the message is displayed if the sum of four open-end parts is not equal to 100. The "type" parameter specifies that the error message should be delivered in the context of questions presented in a table format (assuming that the four open-end questions were displayed in this manner).

The test can be more or less complex. It can also use other questions in the questionnaire. For example, the following condition verifies whether the sum of four answers exceeds the value of another answer:

    #> [CONDITION](AQ3A+AQ3B+AQ3C).GT.AQ2

Testing that responses total 100%

Problem

You want to make sure that responses to a series of questions total 100% (or whatever other value).

Solution

Use a Test pound instruction as in:

    # Test WhateverName =
      #> [TRIGGER]Q1A
      #> [CONDITION](AQ1A+AQ1B+AQ1C+AQ1D).NE.100
      #> [MESSAGE]
      #> [EN]Please make sure the numbers total 100
      #> [FR]Veuillez vous assurer que le total est 100
      #> [TYPE]TABLE

Discussion

The Test pound instruction can be used to implement any specialised logical test. In the one above, the test is triggered by receiving an answer to question Q1A. The test is then implemented: the message is displayed if the sum of four open-end parts is not equal to 100. The "type" parameter specifies that the error message should be delivered in the context of questions presented in a table format (assuming that the four open-end questions were displayed in this manner).

The test can be more or less complex. It can also use other questions in the questionnaire. For example, the following condition verifies whether the sum of four answers exceeds the value of another answer:

    #> [CONDITION](AQ3A+AQ3B+AQ3C).GT.AQ2