Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle SQL Query for Interactive report in apex

VinipandaSep 25 2023

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 
Comments
Post Details
Added on Sep 25 2023
1 comment
380 views