### Correlation (fld, fld), Correlation (fld, fld, condFld), Correlation (fld, fld, condFld, cond)

Basic and Crystal syntax.

##### Arguments

- fld is any numeric field.
- condFld is a field used to group the values in fld by.
- cond is a String indicating the type of grouping for condFld. You only specify this argument when condFld is a Date, Time, DateTime or Boolean field. For more information on the valid strings for this argument, see Conditions for summary functions.

##### Returns

Fractional Number

##### Action

Enables you to calculate the correlation of the specified fields (that is, the degree to which the fields vary in the same manner). For example:

- You can calculate the correlation of two fields, for all the records in the report.
- You can calculate the correlation of two fields for all values within a group (for example, sales grouped by the state that they come from). For information on this kind of summary, see SummaryFunction (fld, condFld).
- You can calculate the correlation of two fields for all the values within a group in which grouping is controlled by changes in a date or Boolean field (for example, sales grouped by the month in which they were made). For information on this kind of summary, see SummaryFunction (fld, condFld, cond).

##### Examples

The following examples are applicable to both Basic and Crystal syntax:

`Correlation({Customer.CUSTOMER ID}, {Customer.CREDIT ID})`

Calculates the correlation between the Customer ID and Credit ID fields.

`Correlation({orders.CUSTOMER ID}, {orders.CREDIT ID}, {Customer.REGION})`

Calculates the correlation between the Customer ID and Credit ID fields, for each region.

`Correlation({orders.CUSTOMER ID}, {orders.CREDIT ID}, {Customer.REGION}, "monthly")`

Calculates the correlation between the Customer ID and Credit ID fields for all the values within each Region group, for each month.

Note: Using this function in a formula forces the formula to be evaluated at print time.

For more information on evaluation time considerations, see Evaluation Time functions.

##### Comments

The correlation will always be a number between -1 and 1, unless the correlation is undefined, in which case the function is assigned a null value (0). If the correlation is 0, the fields are uncorrelated.

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com