Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register
Get Started with Redwood for Oracle Cloud HCM   Begin Now
To ensure that questions get required attention from community members and are NOT left unanswered, it’s important for the author to indicate (by selecting “Yes” or “No” when prompted) whether the question was answered. (newly added) Please note that it is also important to respond to EACH comment your question receives. Your Yes or No response ensures an accurate status for your question.

For more information, please refer to this announcement explaining best practices for getting answers to questions.

SQL Script for Worker's department

edited Nov 22, 2017 9:27AM in Reporting and Analytics for HCM 4 comments

Content

Hi All,

I am trying to get the worker's department along with his name, person number, manager etc. I use the following script to get the department;

SELECT DISTINCT pd.NAME
                           FROM per_all_assignments_f po,
                                hr_all_organization_units pd
                          WHERE 1 = 1
                            AND po.person_id = a.worker_id
                            AND po.assignment_id = a.assignment_id
                            AND po.organization_id = pd.organization_id
                            AND po.business_group_id = pd.business_group_id
                            AND ROWNUM = 1

But this way it returns the department when the employee was assigned very first. Never returns employee's current department. I wonder why it has been so hard to query an employee's department.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!