Aggregation Only - 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-10-04
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
jmh1512506877710
lifecycle
latest
Product Category
Teradata Vantageā„¢

The following example assumes the star1 table exists.

Calling TD_Pivoting with Aggregation Only

SELECT * FROM TD_Pivoting (
  ON star1 AS InputTable PARTITION BY country Order By state
  USING
  PartitionColumns ('country')
  TargetColumns ('sales', 'cogs', 'state ','rating')
  Accumulate('yr')
  Aggregation('sales:SUM','cogs:AVG','state:UNIQUE_CONCAT','rating:CONCAT')
  Delimiters('|')
  CombinedColumnSizes(64001)
) AS dt Order By country;

TD_Pivoting Output

country sales_combined cogs_combined state_combined rating_combined yr
------- -------------- ------------- -------------- --------------- --
Canada   35             0.000        BC|ON          A|A|B           2001
USA     130            16.250        CA|NY          A|B|A|D         2001