The CALCMATRIX Table Operator, available initially in the Teradata 14.10 release, can be used to construct a cross-products, covariance or correlation matrix as a table. It can even be used to build a table that contains one or more “group by” columns, so that the table contains a matrix for each value of this column or combination of columns.
The results of CALCMATRIX without the “group by” feature are similar to those achieved by using the Matrix and Export Matrix analyses in this product.
The parameter Name/Value pairs for this operator are outlined below.
PHASE (‘LOCAL’ / ‘COMBINE’)
CALCTYPE (‘SSCP’ / ‘ESSCP’ / ‘CSSCP’ / ‘COV’ / ‘COR’)
OUTPUT (‘COLUMNS’ / ‘VARBYTE’)
NULL HANDLING (‘ZERO’ / ‘IGNORE’)
The standard Hash By clause is crucial to achieving optimal performance with this operator, while the Local Order By clause is used to achieve the “group by” effect and Partition By is not used.