To collect statistics and analyze data often requires grouping the records of a TSeq or RSeq according to certain conditions.
The commonest group is the Equal Group. Distribute the records from a TSeq or RSeq to several groups according to the same field or expression.
With group() function, you can specify one or more conditions to group the values from TSeq or RSeq.
The group() function for the TSeq or RSeq is similar to the operation of group by in SQL. A sequence composed of multiple groups will be returned. By default, when using group() function, the record will be sorted before grouping according to the results of group expression.
In esProc, you can proceed with the group and summarization computation based on the grouping result.
This differs with that of SQL greatly. SQL does not provide the explicitly data type of sets and the group results cannot be saved either. The SQL users have to group and summarize immediately after the group by action, and then the group result will be dropped, not allowing for any reuse.
Summarize after grouping and you can use groups() function to represent it briefly.
In esProc, the record in the TSeq can be grouped in a rather complicated way.
If you need to perform the equal group on the records in the TSeq or sequence in a specified order, then the align group will be frequently used. With align() function, you can conveniently implement the align group.
Enum group is to group the records according to various conditions. You can implement the enum group with the enum() function.