This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

Creating a sub-report that contains data specific to a context

This example shows how to create a short sub-report that includes a chart showing items bought. The sub-report uses the location as a context variable, so it will only show items bought in the selected location. The example is based on the crocodile survey supplied with Snap WebHost where Q0 specifies the location of the restaurant.

  1. Open the Crocodile survey supplied with Snap.
  2. Create the analyses for the specific restaurant (e.g., a bar chart of Q4, items ordered).
  3. Click Batches button to open the Reports window.

    By default you will have two summary reports available, the questionnaire report, which provides a topline analysis based on the questionnaire layout, and the summary, which provides a chart or table for each question.

    Default reports in reports dialog

  4. Click New button on the Reports window toolbar to add a new report.

    The Report definition window opens, with one default instruction. This report is going to hold the data that is specific to a location. Make this clear in the Label and add a context filter of Q0=Q0@context. This means that everything in this sub-report will only use the data appropriate to the specified location.

    Report showing a highlighted location filter

  5. Click New button on the toolbar to add a new instruction and select Page Layout. The Page Layout instruction dialog opens.
  6. Select Start New Page. This ensures that this sub-report will always start on a new page.

    Printer layout dialog with start new document highlighted

    Click [OK] to save your instruction.

  7. Click New button and select Information. The Information instruction dialog opens.
  8. Leave the title blank (it will appear on your report if you include it). Add some text describing this section of your report. The location details have been added from the [Insert] button, as described in Setting up a derived variable to analyse your data

    Information instruction showing context

  9. Click [OK] to add your instruction to the report.
  10. Click New button and select Execute. The Execute dialog opens.
  11. Select the pre-defined analysis you created.

    Execute AN13 instruction

  12. Click [OK] to save your instruction.
  13. Click Save button to save the report.

See Also

Create a report including a comparison

Executing an instruction in a column label