Reference Guide > TDV Support for SQL Functions > Analytical Functions
 
Analytical Functions
Analytical functions produce summaries, reports, and statistics on large amounts of static data. TDV supports more than three dozen such functions.
Analytical functions are OLAP (on-line analytic processing) functions that operate on large amounts of static data. Most SQL functions are OLTP (on-line transaction processing) functions that operate as quickly as possible on discrete amounts of dynamic, transactional data.
Analytical functions are generally characterized by an OVER keyword and a window clause. (See Window Clause.)
Limitation
Large data sets can be very slow when using analytical functions.
Teradata does not support the RANGE keyword. It only supports the ROWS keyword.
For analytical functions that support the windowing clause, TDV does not push to Teradata without you explicitly suppling the windowing clause. Teradata implicitly adds ROWS BETWEEN UNBOUNDED PRECEEDING AND UNBOUNDED FOLLOWING for analytical functions that do not supply a windowing clause. In TDV and ANSI SQL, RANGE UNBOUNDED PRECEDING is supplied.
Teradata (version 16) does not support the RANGE keyword.
TDV supports the following analytical functions:
CONDITIONAL_CHANGE_EVENT
CONDITIONAL_TRUE_EVENT
CUME_DIST
DENSE_RANK
EXPONENTIAL_MOVING_AVERAGE
EXP_WEIGHTED_AVG
FIRST_VALUE
FIRST_VALUE_IGNORE_NULLS
LAG
LAG_IGNORE_NULLS
LAST_VALUE
LAST_VALUE_IGNORE_NULLS
LEAD
LEAD_IGNORE_NULLS
NTH_VALUE
NTH_VALUE_FROM_LAST
NTH_VALUE_FROM_LAST_IGNORE_NULLS
NTH_VALUE_IGNORE_NULLS
NTILE
PERCENT_RANK
RANK
RATIO_TO_REPORT
ROW_NUMBER