I have table A which describes the number of employees which passed a certain course within a certain branch. The table looks like this:
--------+---------------+---------+--------------------+--------------------+ | Branch | Course_number | Segment | Workers_for_branch | Workers_for_course | +--------+---------------+---------+--------------------+--------------------+ | A | 1 | x | 4 | 1 | | A | 1 | y | 6 | 3 | | A | 2 | x | 4 | 2 | | A | 2 | y | 6 | 1 | | B | 1 | x | 7 | 1 | | B | 1 | y | 5 | 1 | | B | 2 | x | 7 | 2 | | B | 2 | y | 5 | 3 | +--------+---------------+---------+--------------------+--------------------+
Fields interpretation:
- Branch - A or B
- Course_number - 1 or 2 (both courses are taught in each branch)
- Segment - X or Y (both segments are included in each course, hence in each branch).
- Workers for branch - How many workers within a segment for each branch. i.e. Branch A has a total of 10 workers. 4 of them belong to Segment X and 6 belong to Segment Y.
- Workers for course - captures the workers that completed the relevant course. i.e, the first row in the table captures 1 employee of branch A, segment x which passed course number 1.
My goal is to represent the ratio of workers which passed the course out of the potential in each branch. My thinking of the following calculation: (workers_for_course) / total workers for branch.
Please note that the denominator must not be filltered according to course_number and Segment, but only by Branch.
i.e.
I'd like to represent potential of workers who passed the course in branch A, course 1, segment x:
1/(4+6) = 1/10.
on the contrary, the potential of workers who passed the course in branch A, course 1, segment y: 3/(4+6) = 3/10.