count
relationalai.semantics.std.aggregates
count(*args: AggValue) -> AggregateCount the number of values.
Parameters
(*argsAggValue, default:()) - Values to count. Can include Distinct wrapper for distinct count.
Returns
Aggregate- AnAggregaterepresenting the computation of the count. ReturnsInteger.
Examples
Count all employees:
select(aggregates.count(Employee))Count employees per department:
select(Department, aggregates.count(Employee).per(Department))Referenced By
RelationalAI Documentation ├── Build With RelationalAI │ └── Understand how PyRel works │ ├── Build a semantic model │ │ └── Query a model │ │ └── Aggregate results withcountandper│ └── Use advanced reasoning > Rules-based reasoning │ └── Aggregate and group data │ └── Count matches with.count()└── Release Notes └── Python API Release Notes └── What’s New in Version 1.17.0 └── Bug Fixes and Diagnostics