I feel that i’ve gotten close but seem to be failing in grouping.
we have 23,000 employees all identified by a unique employee number (ONROLL[ID]). All employees (except the CEO) have a supervisor that is identified by their employee number (ONROLL[SUPV_ID]).
i’m wanting a new column (ONROLL[CREW_COUNT]). ONROLL[CREW_COUNT] should return the number of times the [ID] from that row appears in the [SUPV_ID] column. With non-supervisors returning a zero (0)
I have tried many approaches that each have returned what i can best describe as ‘grouping errors’. I’ve gotten ‘23,000’ back on every row. I’ve gotten “1” back on every row. I’ve gotten “2,500” (approx number of supervisors) back on every row.
I have partial solved this in a way that works but produces issues later in my project. I created a [SUPV_ID] table… that got crew size for supervisors but did not work for non-supervisors.
Sample Data (“Direct Reports” is what i am trying to achieve)
1