COUNT[Class/class]
The result will look like
119 in COUNT[Class / class] end
SUM_Attribute[Bill/objname,Employee!salary/attrcat]
Unfortunately, the result is returned everytime as a real number, even if the input numbers were integers.
2.5001000000000e+04 in SUM_Attribute[Bill / objname, Employee!salary / attrcat] end
You can use this function also in query class to compute the value of a ``computed_attribute'':
QueryClass EmployeesWithSumSalaries isA Employee with
computed_attribute
sumsalary : Real
constraint
c: $ (~sumsalary in SUM_Attribute[this/objname,Employee!salary/attrcat]) $
endQueryClass PercentageOfQueryClasses isA Real with
constraint
c: $ exists i1,i2/Integer r/Real
(i1 in COUNT[QueryClass/class]) and (i2 in COUNT[Class/class]) and
(r in DIV[i1/r1,i2/r2]) and (this in MULT[100/r1,r/r2]) $
end