Description
Groups a set on some value(s). Used in combination with aggregate function(s).
Example
Group the instances by database type, and count the number of instances in each group
instance->i/groupby(databasetype)->g/$g/databasetype{}/count($i)
instance->i/groupby(databasetype)->g/$g/_1{}/count($i)
instance->i/groupby(databasetype, version)->g/$g/_1{}/$g/_2{}/count($i)
Syntax
groupby(topic1, topic2, ..)/aggregatefunction(..)
Parameters
Type | Description |
---|---|
Topic | The topic(s) to group by |
Discussion
When using the groupby function, a group is created. This group can be anchored with the normal “->” syntax for later reference.
The topics used to create the group can be referenced by name (like “databasetype” in the first example), or by index (like _1 in the second example).
Post your comment on this topic.