View the SQL or MDX for an Entire Report or a Query

View the SQL or MDX to see what is passed to the database when you run a report.

Only SQL is available when using DMR data sources because these data sources were relational.

Procedure

  1. To view the SQL or MDX for the entire report, click the Queries icon Queries icon, right-click the Report icon Report overview icon, and click Show Generated SQL/MDX.

    This option shows the SQL or MDX that will be executed in the data source. The SQL or MDX is organized by query and by query result. If a query is used in more than one data container, a query result is generated for each data container.

  2. To view the SQL or MDX for a specific query, do the following:
    • Click the Queries icon, and click the query.
    • Click the Show properties icon Show properties icon, and In the Properties pane, double-click the Generated SQL property.

    The Generated SQL property shows the SQL or MDX that is executed when you view tabular data (right-click a query and click View Tabular Data). Tabular data shows the data that is produced by the query in the form of a list. You can use this property to help you build advanced queries.

Results

The SQL or MDX for the query appears in the Generated SQL dialog box. For SQL, you can choose to view native SQL, which is the SQL that is passed to the database when you execute the query, or IBM® Cognos® SQL, which is a generic form of SQL that IBM Cognos Analytics - Reporting uses. Cognos SQL is converted to native SQL before the query is executed.