Copy link to clipboard
Copied
Hi, Background: I am querying a table which gives me a list of every people manager in the organization and their direct reports. I am able to do this because of a couple of fields, namely EmpID and MgrID. I loop through each level in the heirarchy and it spits out a list of employees for that manager. It works well and does what I want it to do. The lists that are produced show the employee's first and lastname and Completion date. If there is a date in the completion date column then that means that the employee completed the online course that is mandatory throughout the company.
My question is this. How can I get statistics under each group? For example, under each group I would like to list the following: Total number of employees within the group, number of employees completing the course, and finally the completion rate which is number of completions divided by total number in group. Thank you very much. I have attached my code in a cfm file.
Copy link to clipboard
Copied
Hi,
Use the SQL aggregate functions,
http://www.sql-tutorial.com/sql-aggregate-functions-sql-tutorial/
And if you want to have your statistics as a graphical representation, you can use CF's <cfchart> tag,
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_c_05.html
HTH