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).

← until function / count function →

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment