Computes the covariance between two columns using the sample method. Source values can be of Integer or Decimal type. |

**Covariance** measures the joint variation between two sets of values. The sign of the covariance tends to show the linear relationship between the two datasets; positive covariance indicates that the numbers tend to increase with each other.

- The magnitude of the covariance is difficult to interpret, as it varies with the size of the source values.
- The normalized version of covariance is the correlation coefficient, in which covariance is normalized between -1 and 1. For more information, see CORREL Function.

This function is calculated across a sample of all values.

- For more information on a population version of this function, see COVAR Function.

covarsamp(squareFootage,purchasePrice) |

**Output:** Returns the covariance using the sample method between the values in the `squareFootage`

column and the `purchasePrice`

column.

covarsamp(function_col_ref1,function_col_ref2) [group:group_col_ref] [limit:limit_count] |

Argument | Required? | Data Type | Description |
---|---|---|---|

function_col_ref1 | Y | string | Name of column that is the first input to the function |

function_col_ref2 | Y | string | Name of column that is the second input to the function |

For more information on the `group`

and `limit`

parameters, see Pivot Transform.

Name of the column the values of which you want to calculate the covariance. Column must contain Integer or Decimal values.

- Literal values are not supported as inputs.
- Multiple columns and wildcards are not supported.

Required? | Data Type | Example Value |
---|---|---|

Yes | String (column reference) | `myInputs` |