Grouping Functions

Grouping Functions

In Datameer grouping functions are split into two distinct types of functions, group series functions and aggregate functions.

Group series functions in Datameer are similar to aggregation functions - they group values that have the same key, but they don't aggregate values. The biggest difference between group series functions and aggregation functions is that group series functions usually have more than one result per key where as aggregation functions have only one result per key.
In order to use these functions you must first define groups within your workbook. This can be done using the GROUPBY (), GROUPBYBIN (), or GROUPBYGAP () functions.

Group Series Functions

Group series functions operate row-wise within a group. The function is applied to every row and therefore returns a value for every argument in the group.

INFO

Functions IF, AND, and OR (as well as operators && and ||) arguments are evaluated lazily. This evaluation strategy is used to prevent failures caused by evaluating expressions that may result in an exception.

Problems can occur around lazy evaluation when you are working with the functions that maintain state. This is true for all of the group series functions.

When using a group series function within an IF()'s 2nd or 3rd argument or the functions AND() / OR() in any argument position, Datameer can't guarantee that all of their arguments will be evaluated.

The following functions in Datameer are group series functions:

Aggregate Functions

Aggregate functions combine and then operate on all the values in a group. The function returns one value for each group.

INFO

Due to the different nature of group series functions and aggregate functions, they can't be used in the same workbook sheet.

INFO

Aggregations functions applied to empty groups (all records have been filtered) will result in no entry, e.g. GROUPCOUNT() will not return 0 but no record.

The following functions in Datameer are aggregate functions:

Real World Examples of Group Series Functions

Here we show a few examples of the power of using group series functions and how they can be used in your analyses: