Examples | Matrix Building Function | Vantage Analytics Library - Examples - Vantage Analytics Library

Vantage Analytics Library User Guide

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Lake
Product
Vantage Analytics Library
Release Number
2.2.0
Published
June 2025
ft:locale
en-US
ft:lastEdition
2025-07-02
dita:mapPath
ibw1595473364329.ditamap
dita:ditavalPath
iup1603985291876.ditaval
dita:id
zyl1473786378775
Product Category
Teradata Vantage

Return 3-by-3 ESSCP Matrix as Result Set

call td_analyze (
  'matrix',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children';
);

NULL Value Replacement

call td_analyze (
  'matrix',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   nullhandling = zero;'
);

Return Matrix in Output Table

call td_analyze (
  'matrix',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   outputdatabase = val_results;
   outputtablename = matrix1b;'
);

The function does not return a result set. To see the matrix table, use a SELECT statement. For example:

SELECT * FROM val_results.matrix1b ORDER BY 1;

Limit Data Passed to CALCMATRIX Table Operator

Achieved with the where parameter.

call td_analyze (
  'matrix',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   where = nbr_children > 1;'
);

Return Two Matrixes in One Result Set

Achieved with the groupby parameter.

call td_analyze (
  'matrix',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   groupby = gender;'
);

Return One Matrix of Each Type in One Result Set

call td_analyze (
  'matrix',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   matrixtype = COR;'
);
call td_analyze (
  'matrix',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   matrixtype = COV;'
);
call td_analyze (
  'matrix',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   matrixtype = CSSCP;'
);
call td_analyze (
  'matrix',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   matrixtype = ESSCP;'
);
call td_analyze (
  'matrix',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   matrixtype = SSCP;'
);