Pretty simple.
- Find a query of Investigators
- For each investigator, create a ChartObject record with attributes including the number of open cases
Everything below works except that the count sums all cases for the organization, not just those assigned to the individual investigator.
FIND Investigator Where(Investigator.Organization=LoggedInUser.Organization)
CREATE ChartObject FOR EACH Investigator WITH ChartObject.Investigator=Investigator,
ChartObject.Organization=Investigator.Organization,
ChartObject.ActiveCases=COUNT Case WHERE(Case.Investigator=Investigator AND Case.Stage<>'Closed' AND Case.Stage<>'Complete')