Skip to content

max

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

Find the maximum value.

  • *args

    (AggValue, default: ()) - Values to find maximum from.
  • Aggregate - An Aggregate representing the computation of the maximum value. Returns the same type as the input.

Find maximum salary:

>>> select(aggregates.max(Employee.salary))

Find maximum order amount per customer:

>>> select(Customer, aggregates.max(Order.amount).per(Customer).where(Order.customer == Customer))
RelationalAI Documentation
└──  Build With RelationalAI
    └──  Understand how PyRel works > Use advanced reasoning > Rules-based reasoning
        └──  Aggregate and group data
            └──  Find maximum values with .max()