I have an IG in apex with the following query and table data:
select emp_name,bu,valid_data from employee_bu_units;
EMP_NAME BU VALID_DATA
JOHN SALES Y
JOHN MARKETING Y
ADAM MARKETING Y
ADAM SALES N
ADAM HR N
CLARK HR N
CLARK SALES N
I need to create a report of summarized data for employees which should look something like this:
If Valid = 'Y' for all entries of an employee, then 0. If Valid = 'N' for all entries, then count of the total valid=N rows. If an employee has 2 Y's and 1 N, count column should be 1.
In short report should show invalid entry counts (VALID_DATA='N') for the each employee.
EMPLOYEE INVALID ENTRY COUNT
JOHN 0
ADAM 2
CLARK 2