company logo

group - Group specifications

The group specification provides either a list of categories or a property, which contains the category values. When defining category definitions, conditions can be defined for each category. Categories can also be provided via an enumeration definition.

In case of category definitions categories may overlap, i.e. object instances may correspond to more than one category. Object instances which do not fit to any category are not assigned to any partition.

The grouping operation creates a partition collection (__partition), which stores all instances for a category value. Aggregation operations refer to the __partition property by default.

When calling the function with an invalid type definition or when the type definition does not refer to an view type, the function throws an exception. In order to check, whether the data type is a view type, isView() might be called.

In order to call grouping functions in an operation path, group (or GROUP) should be used, only.

// creates a pertition for each age value

GROUP BY(age)                

// creates partitions by age group

GROUP BY( 'young'  : age < 25,

          'middle' : age >= 25 && age <= 60,

          'old'    : age > 60 )

// call group in ab operation path

person.group(age)