Project:M36 currently supports aggregate functions by applying fold functions to sub-relations, but the functions expect a single-attributed relation. However, if we force the user to project to a single attribute, then duplicate values are only counted once, skewing the aggregation. TutorialD should allow referencing attributes in a sub-relation:
s group ({city, s#, sname, status} as s):{mean:=mean(@s.status)}
The new syntax allows an relation-valued attribute to have a "sub-attribute".
Project:M36 currently supports aggregate functions by applying fold functions to sub-relations, but the functions expect a single-attributed relation. However, if we force the user to project to a single attribute, then duplicate values are only counted once, skewing the aggregation. TutorialD should allow referencing attributes in a sub-relation:
The new syntax allows an relation-valued attribute to have a "sub-attribute".