Covariance (Teradata Database) - Teradata Warehouse Miner

Teradata Warehouse Miner User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.4
Published
July 2017
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
fcf1492702067123.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

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.

Variable Creation > Input > Variables: SQL Elements pane - Aggregation > Covariance

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.

Variable Creation > Input > Variables: SQL Elements pane - Aggregation > Covariance properties