VAR_SAMP Usage Notes - 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

VAR_SAMP with Other Functions

VAR_SAMP can be combined with ordered analytical functions in a SELECT list, QUALIFY clause, or ORDER BY clause.

VAR_SAMP cannot be combined with aggregate functions within the same SELECT list, QUALIFY clause, or ORDER BY clause.

GROUP BY Affects VAR_SAMP Report Breaks

VAR_SAMP operates differently depending on whether there is a GROUP BY clause in the SELECT statement.

GROUP BY Clause Result
Specified VAR_SAMP is reported for each individual group.
Omitted VAR_SAMP is reported for all the rows in the sample.

Measuring the Variance of a Population

If your data represents the entire population for the variable, then use the VAR_POP function.

As the sample size increases, the values for VAR_SAMP and VAR_POP approach the same number, but use the more conservative VAR_SAMP calculation unless you are sure your data constitutes the entire population for the variable.