5.4.5 - Values - Teradata Warehouse Miner

In-Database Analytic Functions User Guide

Teradata Warehouse Miner
February 2018
User Guide


A Values analysis is useful as the first type of analysis to perform on data that is relatively unknown. It helps determine the nature and overall quality of the data. For example, whether the data is categorical or continuously numeric, how many null values it contains, and so on.

A Values analysis provides a count of the number of rows, rows with non-null values, rows with null values, rows with value 0, rows with a positive value, rows with a negative value, and the number of rows containing blanks in the given column. By default, unique values are counted, but this calculation can be inhibited for performance reasons if desired.

For a column of non-numeric type, the zero, positive, and negative counts are always zero (for example, 000 is not counted as 0).

A Values analysis can be performed on columns of any data type, though the measures displayed vary according to column type.


call twm. td_analyze('Values','database=twm_source;tablename=twm_customer_analysis;columns=income,marital_status;Optional Parameters;');

Required Parameters

The columns to analyze.
The database containing the table to analyze.
The table containing the columns to analyze.
The Values parameter:
  • Is required
  • Must be the first parameter
  • Is always enclosed in single quotes

Optional Parameters


If columns are specified with the groupby parameter, a separate analysis is performed for each value or combination of values in the specified columns. For example: groupby=gender,marital_status.

Specifies the name of the database to contain the analysis results table.
Specifies the name of the table to store the analysis results. If not supplied, the results are returned as a result set.

When overwrite is set to true (default), the output tables are dropped before creating new ones.

The unique values count for each selected column when true. By default, unique values are set to true and not counted.
Specifies the SQL WHERE clause generated within the Histogram SQL to filter rows selected for analysis. For example: where=cust_id > 0.


These examples demonstrate the invocation of the Values analysis.To execute the provided examples, the td_analyze function must be installed in a database called twm and the Teradata Warehouse Miner tutorial data must be installed in the twm_source database.

The first example uses a minimal number of parameters and does not produce an output table.

call twm.td_analyze('Values','database=twm_source;tablename=twm_customer_analysis;columns=income,marital_status;');

The second example builds on the first example and produces an output table.

call twm.td_analyze('Values','database=twm_source;tablename=twm_customer_analysis;columns=income,marital_status;outputdatabase=twm_results;outputtablename=_twm_values;groupby=gender;where=cust_id > 0;uniques=false;');

This third example includes additional optional parameters.

call twm.td_analyze('Values','database=twm_source;tablename=twm_customer_analysis;columns=income,marital_status;outputdatabase=twm_results;outputtablename=_twm_values_table;groupby=gender;where=cust_id > 0;');