---
schema_version: "1"
id: 59744eacc34fa494e3d1491f258a06861e2785e1cd067e9f78c76f5520590930
title: Use SAQL in the CRM Analytics Dashboard
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/task/bi-saql-ui.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-ui.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9e8925a96f664720842235167b80ba5f577adcfb223dc0fff5389944e6ca3394
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# Use SAQL in the CRM Analytics Dashboard

Use the CRM Analytics Studio user interface to modify existing SAQL queries or write new ones. Writing SAQL queries in the user interface is the easiest way to get started.

Every component in CRM Analytics uses SAQL behind the scenes. You can build a widget in a dashboard, then switch to the SAQL view to see the SAQL query for the widget. Or, you can create a lens while exploring a dataset, then switch to the SAQL view to see the SAQL query for the lens.

Let’s look at the query generated by a widget in a dashboard.

**note:** After you edit the SAQL for a widget, you may not be able to go back to the dashboard view, depending on how complex the SAQL query is. For more information about working with SAQL queries, see [Tips for Working with SAQL Queries in the Query Editor](https://help.salesforce.com/s/articleView?id=analytics.bi_dashboard_step_saql_limitations.htm&type=5).

1.  In your Salesforce org, open CRM Analytics Studio, then open a dashboard. For example, open Opportunity Details.

2.  Click **Edit**.

    ![Click Edit on a sample dashboard](https://developer.salesforce.com/media/bi_dev_guide_saql/wave_saql_overview_editdashboard.png)

3.  Click a query to edit, for example Amount_1, then click **Edit** in the dropdown list.

    ![Select Edit in a step](https://developer.salesforce.com/media/bi_dev_guide_saql/wave_saql_overview_editstep.png)

4.  Click **SAQL Mode** to display the SAQL query.

    ![Click the SAQL Mode button](https://developer.salesforce.com/media/bi_dev_guide_saql/wave_saql_overview_selectSAQL.png)

5.  View the SAQL query.

    Here is the SAQL query for our example:

    ```nolang
    q = load "DTC_Opportunity_SAMPLE";
    q = filter q by 'Closed' == "false";
    q = group q by all;
    q = foreach q generate sum('Amount') as 'sum_Amount';
    q = limit q 2000;
    ```

6.  Edit the query, then click **Run Query** to run the new query. For example, you could change the `sum` to `average`.
