Reference:9. Grouping Record in TSeq

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.

esproc_reference_group1

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.

esproc_reference_group2

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.

esproc_reference_group3

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.

esproc_reference_group5

Enum group is to group the records according to various conditions. You can implement the enum group with the enum() function.

esproc_reference_group4

Advertisements

About datathinker

a technical consultant on Database performance optimization, Database storage expansion, Off-database computation. personal blog at: datakeywrod, website: raqsoft
This entry was posted in Reference and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s