View insight SQL

Use the View SQL feature to view the SQL behind your Profile, Audience, Destination, and customized insights and execute the query on demand through the Query Editor. Take inspiration from the SQL of over 40 existing insights to create new queries that derive unique insights from Platform data based on your business needs.

To open your chosen dashboard, select either Profiles, Audiences, or Destinations from the left navigation. Next select Overview from the tab options if the workspace does not automatically appear.

Alternatively, select Dashboards from the left navigation followed by the name of your custom dashboard. The overview of your user-defined dashboard appears.

The Experience Platform UI with Profiles, Audiences, Destinations, and Dashboards highlighted.

View SQL toggle toggle

A toggle is available from the overview of the Profile, Audience, Destination, and user-defined dashboards to enable or disable the feature.

NOTE
If you enable the View SQL toggle, you cannot change global and widget level filters until you disable the feature.

The View SQL toggle highlighted.

Enable the toggle to display View SQL text on each individual insight.

An insight with View SQL highlighted.

Select View SQL to open a dialog that contains the widget’s SQL.

SQL dialog sql-dialog

A dialog appears that contains the title of the insight and the SQL that generates it.

TIP
You can copy the entire SQL statement to your clipboard by selecting the copy icon ( The copy icon. ) in the top right of the dialog.

An insight dialog with the SQL statement highlighted highlighted.

Select Run SQL to open the Query Editor with the query is pre-populated.

An insight dialog with Run SQL highlighted.

Edit existing SQL edit-sql

The Query Editor appears. You can now edit the statement and query your platform data in a fashion that better suits your reporting needs. Save your new query template with an appropriate name.

The Query Editor with your chosen insight SQL prepopulated.

Next steps

After reading this document, you now understand how to access the SQL for any insight within either the standard dashboards or a user-defined dashboard. If you have not already done so, you are recommended to read the Real-Time Customer Data Platform Insights Data Model document. That document contains insights on customizing SQL templates for Real-Time CDP reports tailored to your marketing and KPI needs.

recommendation-more-help
ececc77d-ff44-4382-85ee-a087c8834323