TD_NumApply Example | TD_NumApply | Teradata Vantage - Example: How to Use TD_NumApply - 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ā„¢

Every complete example in this document is available in a zip file that you can download. The zip file includes a SQL script file that creates the input tables for the examples. If you are reading this document on https://docs.teradata.com/, you can download the zip file from the attachment in the left sidebar.

TD_NumApply InputTable: input_table

 passenger survived pclass gender age sibsp parch fare         cabin embarked                                 
 --------- -------- ------ ------ --- ----- ----- ----         ----- --------
         1        0      3   male  22     1     0  7.250000000  null        S                                       
         2        1      1 female  38     1     0 71.280000000   C85        C                                       
         3        1      3 female  26     0     0  7.930000000  null        S                                       
         4        1      1 female  35     1     0 53.100000000  C123        S                                       
         5        0      3   male  35     0     0  8.050000000  null        S   

Example: TD_NumApply Using LOG Method

SELECT * FROM TD_NumApply (
  ON numApply_input AS InputTable PARTITION BY ANY
  USING
  TargetColumns ('Age','Fare')
  ApplyMethod ('log')
  Accumulate ('Passenger')
  InPlace ('true')
) AS dt;

TD_NumApply Output

 passenger age         fare
 --------- ---         ----
         1 3.091042453 1.981001469
         2 3.637586160 4.266615783
         3 3.258096538 2.070653036
         4 3.555348061 3.972176928
         5 3.555348061 2.085672091