Skip to content

asc

relationalai.semantics.std.aggregates
asc(*args: AggValue) -> Ordering

Specify ascending order for values in sorting and ranking operations.

  • *args

    (AggValue, default: ()) - Values to sort in ascending order.
  • Ordering - An Ordering object representing ascending order.

Rank employees by salary in ascending order:

>>> select(Employee, aggregates.rank(aggregates.asc(Employee.salary)))
RelationalAI Documentation
└──  Build With RelationalAI
    └──  Understand how PyRel works
        ├──  Build a semantic model
        │   └──  Query a model
        │       └──  Rank and select top results with rank, asc, desc, and top
        └──  Use advanced reasoning > Rules-based reasoning
            └──  Aggregate and group data
                └──  Rank groups with .rank()