Wolfram Language

Aggregate Values

Aggregation is the process of reducing a list of values to a single value. Version 12 introduces AggregatedEntityClass, which allows grouping entities by a predicate. Properties are defined by applying aggregate functions to those groups.

Start with "PlanetaryMoon" entities, group them by orbit centerthe (minor) planet those moons are circling aroundand then define the properties "moon count" and "total moon mass".

List entities in this class.

Here is the list of properties.

Get the count and total mass for moons circling Mars.

Make a Dataset of the moon counts.

You can omit the "group by" clause, which results in a class containing a single entity.

Now you can get the count of all planetary moons.

Related Examples

de es fr ja ko pt-br zh