View the SQL for a report

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

Before you begin

You must be in edit mode in the report.


  1. From the navigation menu, click the Queries folder.
    navigation drop-down
  2. Click More more icon, and then select Show generated SQL/MDX.

    The Generated SQL window opens and displays the queries in the report.

  3. In the Query results pane, click a query result.

    The SQL for the query is displayed. If a query is used in more than one data container, a query result is generated for each data container.

  4. In the drop-down list in the Generated SQL/MDX pane, you can choose 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.