sum
relationalai.semantics.std.aggregates
sum(*args: AggValue) -> AggregateCompute the sum of values.
Parameters
Section titled “Parameters”
(*argsAggValue, default:()) - Values to sum. Can include Distinct wrapper for distinct aggregation.
Returns
Section titled “Returns”Aggregate- AnAggregaterepresenting the computation of the sum. ReturnsNumberif the input isNumber, orFloatif the input isFloat.
Examples
Section titled “Examples”Sum order amounts:
>>> select(aggregates.sum(Order.amount))Sum employee salaries per department:
>>> select(Department, aggregates.sum(Employee.salary).per(Department))Referenced By
Section titled “Referenced By”RelationalAI Documentation
└── Build With RelationalAI
└── Understand how PyRel works > Use advanced reasoning > Rules-based reasoning
└── Aggregate and group data
└── Sum values with .sum()