Loading
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
          Add Custom Formulas to Columns

          Add Custom Formulas to Columns

          Use the column editor to define custom formulas in compare tables or charts. View measures side by side, and perform math across the table’s columns and rows. Use string values to create labels, concatenate dimension values, provide simple buckets, or add image URLs.

          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. In the lens, click the Table Mode icon and select Compare Table.
          2. On the Data tab, click analytics explorer add button under Measures.
          3. Add dimensions by clicking analytics explorer add button in the Group by panel.
            Null values that occur in the data are displayed as minus signs (-).
          4. Change the first measure by clicking the initial selection (Count of Rows). Add more measures by clicking analytics explorer add button under Measures in the Data tab.
            explorer compare table with measures and dimension groupings
          5. To enter a custom formula, click analytics explorer add button under Measures and click Add Formula.
            Add Formula
            In the column editor, you can enter text string formulas, SAQL formulas, including math functions, or choose a windowing function to calculate the values in the column. You can also name the column and choose a number format. If a formula contains division by 0, the result is displayed as a minus sign (-).
            Compare Table edit column
            If you want to preserve an existing column, select Clone Column from the original column's action menu. You can edit the cloned column instead of the original.
          6. In the Formula field, create formulas using these operators.
            Symbol Examples Calculation
            + A+B, A+100 Addition, applied per row.
            - A-B, A-100 Subtraction, applied per row.
            / A/B, A/100 Division, applied per row.
            * A*B, A*100 Multiplication, applied per row.
            ( ) (B-A)/(A*100) Parentheses for grouping operations.

            Dimension columns are on the left and measure columns are on the right. The measure columns are identified in formulas as A, B, C, and so on, with A being the far-left measure column.

            You can also create string formulas. For example, this formula creates simple buckets.

            Column editor showing a formula that creates three simple buckets

            You can’t use columns based on string formulas as dimensions for grouping in charts, but you can use them to apply conditional formatting in charts.

          7. To use SAQL, enter it directly into the formula editor, and click Apply to see the result.
            See the CRM Analytics SAQL Developer Guide for more information on writing SAQL.

            Some SAQL functions can’t use letter references for columns, such as A, B, C. The percentile_desc and percentile_cont functions, for example, require raw field names as arguments. See Use Raw Field Names in Query Formulas for more information.

            Compare Table formula editor SAQL
          8. To use a function, choose the function editor and then choose a windowing function from the menu. After you configure the function, click Apply to see the result.
            Compare Table function editor
            Switch to the formula editor to see the SAQL generated by the chosen function. You can edit the SAQL in the formula editor after generating it with a function as if you’d written it.
            Compare Table function editor SAQL

            Filters on formula columns aren’t supported.

          9. To open a column's action menu, click the down arrow.
            Compare Table Menu
          10. To change a column's name or formula, click Edit this Column.

          Numeric formats use the period as a decimal separator and the comma as a grouping symbol. The currency formats are restricted to dollars and cents.

           
          Loading
          Salesforce Help | Article