We are struggling to get some statics to work the way we want them to.. (sorry if this is a stupid question but we have tried searching for relevant examples the entire day now ..)
We are running a process that collects installation and service jobs from a system and we are trying to COUNT it by user and save it to a statistic BO.
We have managed to get all the users out from the system and it show one row per user as we want it to do. But we cannot get the count right. It seems as it counts the first users jobs and put it on every user. If we change the sorting it will give us another number but always the same in every row.
It’s the two COUNT rows that we have problem with.
Any help is much appreciated!
The process look like this:
FIND RegularUser WHERE (RegularUser.LoginName<>'admin') ORDER BY RegularUser.LoginName DESC
CREATE Bokningsstatistik FOR EACH RegularUser WITH Bokningsstatistik.Tekniker=RegularUser.LoginName,
Bokningsstatistik.Installationer=COUNT Bokningar WHERE (Bokningar.Jobbtyp='Installation' AND Bokningar.Tekniker=RegularUser),
Bokningsstatistik.Service=COUNT Bokningar WHERE (Bokningar.Jobbtyp='Service' AND Bokningar.Tekniker=RegularUser),