Reusable grouping

  • Different from that of SQL, the grouping of esProc can be independent from the summarizing and the grouping result is reusable. This is compatible with the true meaning of grouping operation.
  • Based on the result of grouping for one time, multiple times of sorting, summarizing, and filtering can be implemented.
  • The reusable grouping is not only intuitive and easy-to-understand, but also convenient for stepwise computation, enabling user to control the data more flexibly.
  • Since the grouping result is reusable, you are never required to group repeatedly before every statistics followed. The cost of computation is thus saved, and the efficiency of computation is improved.
A
1 =db.query(“select * from Employee”) Staff list
2
=A1.group(month(Birthday),day(Birthday))
Group by birthday
3 =A2.select(~.len()>1) Union the groups with more than 1 member,that is,employees of the same birthday
4 =A3.conj()
5
=A1.group(Dept)
Group by Dept
6 =A5.select(~.count()>=3) Find out departments with over 3 employees according to the grouping result
7
=A6.new(Dept,~.avg(Age):avgAge,~.maxp(Birthday).Name:youngest)
Create a table sequence according to the grouping results once again