TD_RoundColumns Column Examples - Analytics Database

Database Analytic Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-06
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
jmh1512506877710
Product Category
Teradata Vantageā„¢

You can also input multiple columns in the TargetColumns parameter to have these statistics calculated for all those columns at the same time. If you want stats for all columns, a shorter way to do this would be to add [:] in the TargetColumns parameter.

titanic2: Input Table

The following input table is used for these examples.

passenger p_class survived fare height_cms
5 3 0 8.10 137.90
3 3 1 7.90 155.10
4 1 1 53.10 130.70
1 3 0 7.30 145.30
2 1 1 71.30 134.70

Multiple Columns SQL Call

SELECT * FROM TD_RoundColumns (
  ON titanic2 AS InputTable
  USING
  TargetColumns ('fare','height_cms')
  PrecisionDigit (1)
  Accumulate ('[0:1]','survived')
) AS dt;

Multiple Columns Ouput

passenger p_class survived fare height_cms
5 3 0 8.10 137.90
3 3 1 7.90 155.10
4 1 1 53.10 130.70
1 3 0 7.30 145.30
2 1 1 71.30 134.70

All Columns SQL Call

SELECT * FROM TD_RoundColumns (
  ON titanic2 AS InputTable
  USING
  TargetColumns ('[:]')
  PrecisionDigit (1)
) AS dt;

All Columns Output

passenger p_class fare height_cms survived
5 3 8.10 137.90 0
3 3 7.90 155.10 1
4 1 53.10 130.70 1
1 3 7.30 145.30 0
2 1 71.30 134.70 1