Define a query for an interactive report definition
A query-based interactive report has a query associated with it. When the user runs the report, the user specifies values for the variables in the query. The application then runs the report against cases that meet the criteria of the query.
If you want user-specified values from a query to be used as breakdown details for a report column or row, you must do both of the following:
- Include the breakdown variable in the query.
- Specify Query Values for the variable's breakdown details.
If you set up a breakdown variable to use query values but you do not include the variable in the query that is part of the report definition, the application cannot determine the breakdown values. If a column or row variable has no breakdown values, the application drops it when running the report. If this results in a report without rows or columns, the report cannot be run.
If you include a breakdown variable in the query but do not set up the breakdown variable to use query values, the application uses any values that a user specifies for the query to select cases to include in the report, but does not use those values as breakdown details. For example, the query is for generic name and generic name is a breakdown variable with Every Distinct Value specified for breakdown details. If the user specifies DrugA as the query value, the report includes only cases with DrugA, and it includes a column for each value of generic name for those cases.
Parent topic: Query-based interactive reports