Report job:
or

Intelligence Server or Developer diagnostics
Open the Diagnostics Configuration editor through one of the following actions:
NOTE: If the report will be run in a two-tier connection, configure the diagnostics on the Developer machine. In three-tier, the diagnostics should be set up on the Intelligence Server machine.
NOTE: Disable the trace after the SQL appears to optimize performance.
Data Flow Control (DFC) Engine tracing:
Enterprise Manager job data:
If the project is configured to log SQL statements into the Enterprise Manager repository, SQL statements may be retrieved using the Enterprise Manager project. The attribute "Report Job SQL Pass" contains the SQL statement text.
View SQL on the database side:
Depending on the warehouse platform, users can view the SQL from the database side.
Element Browsing Request:
Only Intelligence Server/Developer diagnostics, DFC Engine logging, and viewing SQL on the database side can be used to retrieve the SQL for Element Browsing Requests.