Skip to content

variance_samp

relationalai.semantics.std.aggregates
variance_samp(*args: AggValue) -> Aggregate

Compute the sample variance of values.

  • *args

    (AggValue, default: ()) - Values to compute sample variance over. Can include Distinct wrapper for distinct aggregation.
  • Aggregate - An Aggregate representing the computation of the sample variance. Always returns Float.

Compute sample variance of salaries:

select(aggregates.variance_samp(Employee.salary))

Compute sample variance of salaries per department:

select(Department, aggregates.variance_samp(Employee.salary).per(Department))