Loading
Intermittent Errors with Salesforce Trial Org Registration Read More
CRM Analytics
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          View the Query Behind Your Lens

          View the Query Behind Your Lens

          CRM Analytics uses Salesforce Analytics Query Language (SAQL) or Salesforce Object Query Language (SOQL) behind the scenes in lenses and dashboards to gather data for visualizations. You can view and edit the underlying code that’s written as you explore, or copy it for use elsewhere.

          Required Editions

          Available in Salesforce Classic and Lightning Experience.
          Available with CRM Analytics, which is available for an extra cost in Enterprise, Performance, and Unlimited Editions. Also available in Developer Edition.
          User Permissions Needed
          To view visualizations: Use CRM Analytics
          1. Explore a dataset to get the visualization or table of data you want.
            Analytics explorer stacked bar chart
          2. Click Query Mode to view the query's SAQL or SOQL code.
            Analytics explorer in saql mode
          3. To change the query, edit the code and then click Run Query.
            Query results appear in a table below the query editor.

          For more information about SAQL, see the CRM Analytics SAQL Developer Guide.

          Tips and Considerations when Working with Lens Queries

          Keep these tips and considerations in mind when working with the queries behind your lenses.

          • To work with multiple datasets simultaneously, reference them in the JSON editor for the currently running lens. To open the editor, press Ctrl + E or Cmd + E and use the load statement to load each dataset you want to explore.
          • If you run a query while exploring, the filters become read-only while in chart and table modes. To make the filters editable, click Analytics explorer history button and return to a point in the history before you ran the query.
          • If you save the lens with filters in read-only mode, they remain in read-only mode. Your exploration history isn’t saved with the lens and can’t be used to undo the read-only state.
          • If you want to work in query mode and apply conditional or number formatting to a column, or rename the column, run the query before making these changes.
          • If your query includes interactions and you switch to Query Mode, continue making all subsequent changes in Query Mode. Editing a query using the interface afterward will disrupt existing interactions.
           
          Loading
          Salesforce Help | Article