For more information, please refer to this announcement explaining best practices for getting answers to questions.
Report | SQL query to get details of the employees belonging to departments below the selected depar
Content
Requirement:
1) Report should display employees belonging to the departments of the selected organization type.
2) Report should also display employees belonging to departments below the selected departments as per organization hierarchy.
Scenario: Suppose the department of the employee is DEPARTMENT4.3 then the report should fetch the data of the employee whose department is DEPARTMENT4.3 along with the employees who belong to DEPARTMENT4.3.1, DEPARTMENT4.3.2, DEPARTMENT4.3.3, DEPARTMENT4.3.3.1.
Organization tree hierarchy:
NODE1:LEGAL EMPLOYER(ROOT)
NODE2: DEPARTMENT1
NODE3: DEPARTMENT1.1
NODE4: DEPARTMENT1.1.1
DEPARTMENT1.1.2
NODE3: DEPARTMENT1.2
NODE2: DEPARTMENT2
NODE2: DEPARTMENT3
NODE3: DEPARTMENT3.1
DEPARTMENT3.2
NODE2: DEPARTMENT4
NODE3: DEPARTMENT4.1
DEPARTMENT4.2
DEPARTMENT4.3
NODE4: DEPARTMENT4.3.1
DEPARTMENT4.3.2
DEPARTMENT4.3.3
NODE5: DEPARTMENT4.3.3.1