product
relationalai.semantics.std.aggregates
product(*args: AggValue) -> AggregateCompute the product of numeric values using the exp-log trick.
Handles negative inputs by taking abs before log-summing and tracking the sign via the parity of the negative-value count. Note: zero inputs yield a NaN result row (ln(0) is not finite); in grouped queries the NaN is contained to its own group and does not affect other groups. Results are floating-point approximations — integer inputs are cast to Float before aggregation.
Parameters
(*argsAggValue, default:()) - Values to multiply together.
Returns
Aggregate- AnAggregaterepresenting the product. Always returnsFloat.
Examples
Compute product of all quantities:
select(aggregates.product(Item.quantity))Compute product per category:
select(Category, aggregates.product(Item.quantity).per(Category))