Returns the correlation value of two fields or arrays. A correlation is a number that describes the degree of relationship between two fields. The correlation coefficient may take on any value between plus and minus one.
Correlation( fld, fld ) Correlation( fld, fld, condFld ) Correlation( fld, fld, condFld, cond )
fld | The name of a field or array variable whose values should be used to calculate the correlation value. |
---|---|
condFld | The name of the field that groups the values of both fields (if both fields are not arrays). |
cond | A string declaring the type of grouping to be used on condFld. This only makes sense for groups based on Date, DateTime, Time, and Boolean fields. See Summary Field Conditions for a list of strings you can use here. |
A fractional number.
//computes the correlation between the values of a field "production" of table "factory" //and the values of a field "faults" of a table "material". correlation({factory.production},{material.faults})
//computes the correlation of two arrays correlation([1,2,3,4,5,6],[1,2,1,2,3,1]) //returns 0.26
//computes the correlation of the return value (has to be an array) //of the formula fields "makeArrayFemales" ans "makeArrayMales" correlation({@makeArrayFemales}, {@makeArrayMales})
//computes the correlation between factory production and material faults grouped by vendor correlation({factory.production},{material.faults},{Vendors.VendorID})