TD_SUM_NORMALIZE_OVERLAP Input and Output - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
TD_SUM_NORMALIZE_OVERLAP is a table function that takes three arguments. The arguments passed to the function are the specified columns in a subtable derived from using the WITH Request Modifier as follows:
  • The first argument is one or more grouping columns, not including the Period column.
  • The second argument is a numeric column on which SUM() is requested. All numeric data types are supported.
  • The third argument is the Period column where you want to find the Period values that overlap.
Input to the table function must be columns that are hash-redistributed on the grouping columns and sorted by the grouping columns and the Period values as follows:
  • You must specify a LOCAL ORDER BY clause that includes all of the grouping columns and the Period column in the same order that was specified in the input arguments. The sort order must be ascending.
  • You must include a HASH BY clause with at least one of the grouping columns. The HASH BY clause cannot include the Period column or any columns that are not part of the grouping columns.
You must invoke the function with a RETURNS clause that specifies the output columns as follows:
  • You must specify the output columns to be the same as the columns specified in the input arguments, including the Period column.
  • You must specify the output columns with the same data types and in the same order as the corresponding input columns.
  • You must include a numeric output column to contain the sum result value. The data type of this column must be the same data type as the corresponding input column.