This function is only available when connected to a Teradata database.
An enhanced version of the standard covariance function is supported, generating COVAR_SAMP(expression1, expression2) for the sample covariance or COVAR_POP(expression1, expression2) for the population covariance, while returning a value of type float. When dragging a Covariance into a variable, the following tree element is created.
Columns and/or other non-aggregate expressions can be moved over the two (empty) branches of the tree.
The enhancement consists of the ability to compute the covariance when either or both the first and second expression arguments evaluate to type date, generating one of the following (in which COVAR_POP may be substituted for COVAR_SAMP):
COVAR_SAMP(date expression1 - DATE '1900-01-01', expression2) COVAR_SAMP(expression1, date expression2 - DATE '1900-01-01') COVAR_SAMP(date expression1 - DATE '1900-01-01', date expression2 - DATE '1900-01-01')
The option to compute the covariances on the population or sample is offered through the Properties panel. Double-click on Covariance, or highlight it and click Properties.