Форум

I have a collection of agents called employees that have an attribute called Age. I am trying to use the method called count(java.lang.String triggerFieldName) which returns the number of active objects in this collection which have true value of a boolean field with name triggerFieldName I am avoiding using the Statistic dialogue box in employees because I need to make 60 distinct groups. I tried employees.count("item.Age == 20"); employees.count("this.Age == 20"); employees.count("employees.Age == 20"); all give error that I am giving an incorrect trigger field name. so my question how do I define a triggerFieldName and an example to how to get a count of employees that are 20 years old. Thanks ahead of time
The argument of "count()" method should be the name of the boolean field/variable that can be equal to true or false. Lets assume you have a boolean "plainVar" inside "employees" agent. In this case you can call "employees.count("plainVar")". It will return the number of agents where this variable has a value equals to true.

Ваше сообщение