​​

Employee Counts Versus Position Counts

True or false?  The report below will generate a 'head' count of employees by CBID:  

 

EX AC

TABLE FILE AC

COUNT AC:SSA

BY AC:CBID

END

 

The answer is false.  At first glance it might appear the report is generating a head count, but the request is retrieving both AC:SSA and AC:CBID for each record (position) in the AC file.  So, if an employee has multiple positions, multiple occurrences of the same SSA will be retrieved and counted.   

 

If you are trying to count employees (AC:SSA) only once, use the prefix operator: DST to get a count of DISTINCT values.  In the example below, the command COUNT DST.AC:SSA is used to sum the count of distinct occurrences of the field AC:SSA for each CBID.  Note that if an employee has multiple positions in different CBID's they will be counted once in each CBID.

 

EX AC

TABLE FILE AC

COUNT DST.AC:SSA

BY AC:CBID

END​


Last Updated: March 1, 2024