Real Sense Grouping

esProc grouping completely covers a variety of situations, which is more agile and easier to use than SQL to solve the grouping related problems.

In esProc, grouping and summary can be divided into two steps. The grouping results can be reused or for secondary processing, such as sorting, query, and re-grouping. Besides SQL supported direct grouping (equivalent grouping) based on a field in the data set, esProc grouping can be based from external instead of the original data set, such as from the parameters, other data sets, temporarily organized sets, etc. In addition, esProc can also conveniently group under the boolean conditions.

Align grouping

  • The criteria of align grouping is not assigned by the original dataset but is from the external sources such as parameters, other datasets, and the set temporally organized by users.
  • For example, to check the insurance policy of top N sales person who get the least customer complaints, you can retrieve the list of sales person meeting the complaint conditions from the CRM system, and group these policy data in the policy system by this list.
  • Align grouping makes the criteria of grouping no longer limiting to the original dataset. The flexibility of grouping is thus improved.
  • The align grouping belongs to the non- equivalence grouping, which support the null set in the result of grouping.
A
1 =db.query(“select * from Employee”)
2 =[“Sales”,”R&D”,”Admin”,”Support”]
3
=A1.align(A2,Dept)
Align group
4
=A3.new(Dept,~.count():Quantity,~.avg(Age):avgAge)
Constitute a table sequence by grouping results
Enum grouping

  • The grouping criteria of enum grouping can be from the expression. For example, group the employees into 3 teams by a certain criteria, a team for those younger than 30, a team for those aged between 30 and 40, and a team for those order than 40.
  • Enum grouping is also a kind of non-equal group which is generally characterized with “result is obtained in a way consistent with the grouping criteria). You can directly and simply implement some features that are hard for SQL to implement.
  • The unwanted group can be removed directly. For example, to group the data into 2 groups, one group for those between 30 and 40, and one group for those higher than 40, then the result is collected in only these 2 groups. (For SQL, there will be an extra empty group).
  • Even if a certain group of data is empty, the result of enum grouping operation will still keep this group. In the below example, suppose if there is not any employee younger than 30, then this group still exist with a count of member equaling 0 (this group does not exist for SQL).
  • The non-equal grouping enables users to control the group member more flexibly. For example, to group into a team for employees between 20 and 40, and a team for employees between 30 and 50, then those aged between 30 and 40 can appear in either team or both teams. (For SQL, it is only allowed to appear in either team).
A
1 =db.query(“select * from Employee”)
2 =[“?<=31″,”?>31 && ?<=41″,”?>41″] Enum group conditionally
3
=A1.enum(A2,Age)
4 =[“?<=31″,”?>21 && ?<=41″,”?>51″] Option of @r allows the overlap of enum group
5
=A1.enum@r(A4,Age)