You are here:
computeRelative Parameters
When you define a computeRelative transformation, you set the action attribute to
computeRelative. You also specify the parameters for the
input source, partition-by field, sort field, and derived field definitions.
Parameters
You can specify parameters in the following sections of the computeRelative node.
The following 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. |
| partitionBy | Yes | API name of the field used to partition the records in the dataset. Specify one partition-by field only. |
| orderBy | Yes | Field used to sort the records within each partition and the sort order:
ascending ( Example: |
| computedFields | Yes | A list of definitions for derived fields. Derived fields can be based on a source field or on a SAQL expression. Example showing derived fields based on a source field and on a SAQL expression: |
computedFields
The following table describes the attributes in the computedFields section.
| Parameter | Required? | Value |
|---|---|---|
| name | Yes | API name of the derived field to add to the dataset. The name must be unique in the dataset. If the name is not unique, the dataflow fails to run. |
| label | No | The display name of the derived field that appears in the CRM Analytics user interface. Can be up to 255 characters. Defaults to the API name if not specified. |
| description | No | Description of the derived field for information only. |
| expression | Yes | Expression attributes 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: |
expression
The following table describes the attributes in the expression section when creating a derived field based on a source field.
The following table describes the attributes in the expression section when creating a derived field based on a SAQL expression.
| Parameter | Required? | Value |
|---|---|---|
| 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. You can use the offset functions Example to calculate the percentage change from the previous amount to the current amount: You can also use the SAQL case operator in the expression. Example to output Up, Down, or No Change values based on the change from the previous amount to the current amount: |
| type | Yes | CRM Analytics field type associated with the field. Valid types are Date, Numeric, and Text. Example: |
| scale | No | The number of digits to the right of the decimal point in a numeric value. Example: |
| default | Yes (for numeric fields only) | The default value if one can’t be calculated. Example: |

