Conditionally including content in your reports

You can set up conditions on parts of your report so they will only be put in the report if the conditions are met. You enter conditions in the N/A field on a report instruction. Conditions can be applied to any instruction that puts content in the report. These are:

  • Execute instructions
  • Analysis (table, chart, list etc) instructions
  • Information instructions
  • Test grid instructions

The conditions must be a true/false evaluation, (such as whether data is in a chart). You can only use evaluation expressions that are available for the survey as a whole. This means you can:

  • evaluate values in analyses (e.g. table cells)
  • evaluate a survey field variable (such as cases)
  • evaluate a variable@context (e.g. month@context=Jan)

You cannot use expressions that depend on the response in a particular case, such as NUM.

For example, the instruction below will only add the text to the report if the value in the table cell, row two of column one of table AN1 is not greater than 14.

Information report instruction that is conditionally included

The chart below will only be created if the chart C5 had data in it.

Conditionally include content using N/A information

For reference information about the sort of expressions which can be used in a N/A field, see the list of filter expressions.

When creating reports that include conditional content, it is worth testing the report by running it with the option Print report item numbers. This tags each bit of the report with the report name and instruction number that created that content. You can then see exactly which instruction in which sub-report has produced content (or not).

Contents