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
          computeExpression Parameters

          computeExpression Parameters

          When you define a computeExpression transformation, you set the action attribute to computeExpression. You also specify the parameters for the input source and the expression used to generate the values.

          Parameters

          You can specify parameters in the following sections of the computeExpression node: parameters and computedFields.

          This table describes the parameters in the parameters section.

          Parameter Required? Value
          source Yes Node in the dataflow definition file that identifies the input source for this transformation.
          mergeWithSource No Indicates whether the input fields are included with the derived fields in the resulting dataset. When true, the resulting dataset contains all input fields from the source and the newly generated derived fields. When false, the resulting dataset contains the derived fields only. Default is true.
          computedFields Yes Attributes and expression used to generate derived fields in the dataset.

          computedFields

          This table describes the attributes in the computedFields section. It also describes optional attributes that you can provide to override the field metadata to make the data appear differently in a dataset. For example, CRM Analytics can replace null values in a field with a default value.

          Attribute Required? Value
          name Yes API name of the generated field. The API names must be unique. Otherwise, the dataflow fails to run.
          type Yes

          CRM Analytics field type associated with the field. Valid types are Text, Numeric, or Date.

          Example:

          "type": "Text"
          label No The display name of the generated field that appears in the CRM Analytics user interface. Can be up to 255 characters. Defaults to input field name if not specified.
          saqlExpression Yes

          SAQL expression used to calculate the value for the derived field. The expression can be based on input fields or other derived fields in the transformation.

          Example:

          "saqlExpression":"toDate(birth_day, \"yyyy-M-d\")"

          If a field name in a SAQL expression contains characters other than letters, numbers, or underscores, enclose the name in single quotes. For example, field names resulting from an augment are prefixed with the relationship name and a dot, and must be. enclosed in single quotes.

          "saqlExpression":"'AccountId.Sales_Q4__c'-'AccountId.Sales_Q3__c'"

          The use of multivalue fields as input fields isn’t supported.

          format Yes (for Date fields only) Format of the derived date field. For information about formats, see the Analytics External Data Format Developer Guide.
          fiscalMonthOffset No

          For date fields only. The difference, in months, between the first month of the fiscal year and the first month of the calendar year (January). For example, if the fiscal year starts in January, the offset is 0. If the fiscal year starts in October, the offset is 9.

          Example:

          "fiscalMonthOffset": 9

          When you set fiscalMonthOffset to a value other than 0, CRM Analytics generates fields to show the fiscal week, month, quarter, and year that a date value falls in. You can use these fields to group and filter by fiscal period in a dataset.

          CRM Analytics doesn’t support fields with different fiscalMonthOffset values in the same dataset. Using different fiscalMonthOffset values can produce unexpected results when you filter by relative fiscal date ranges. We recommend that you set the same value for all fiscalMonthOffset attributes in a dataset.

          isYearEndFiscalYear No

          For date fields only, when fiscalMonthOffset is greater than 0. Indicates whether the fiscal year is the year in which the fiscal year ends or begins. Because the fiscal year can start in one calendar year and end in another, you specify which year to use for the fiscal year.

          • If true, then the fiscal year is the year in which the fiscal year ends. The default is true.
          • If false, then the fiscal year is the year in which the fiscal year begins.

          Example:

          "isYearEndFiscalYear": true

          CRM Analytics doesn’t support fields with different isYearEndFiscalYear values in the same dataset. Using different isYearEndFiscalYear values can produce unexpected results when you filter by relative fiscal date ranges. We recommend that you set the same value for all isYearEndFiscalYear attributes in a dataset.

          firstDayOfWeek No

          For date fields only. The first day of the week for the calendar year and, if applicable, the fiscal year. Use 0 to set the first day to be Sunday, 1 to set the first day to be Monday, and so on. Use -1 to set the first day to be on January 1. The default is -1.

          Example:

          "firstDayOfWeek": 0

          CRM Analytics doesn’t support fields with different firstDayOfWeek values in the same dataset. Using different firstDayOfWeek values can produce unexpected results when you filter by relative week date ranges. We recommend that you set the same value for all firstDayOfWeek attributes in a dataset.

          precision Yes (for Numeric fields only)

          The maximum number of digits in a numeric value, or the length of a text value. For numeric values: Includes all numbers to the left and to the right of the decimal point (but excludes the decimal point character). Value must be from 1 to 16. For text values: Value defaults to 255 characters, and must be from 1 to 32,000 characters.

          Example:

           "precision": 10
          scale Yes (for Numeric fields only)

          The number of digits to the right of the decimal point in a numeric value. Must be less than the precision value. Value must be from 1 to 15 characters.

          Example:

          "scale": 2
          defaultValue No

          For text and numeric fields that can be null. Default value that replaces a null value for the specified field. Enter the default value as a string.

          Example:

           "defaultValue": "0"
           
          Loading
          Salesforce Help | Article