RKD Employee Element History

Description
Columns: Employee Number, Full Name, Period Name, Element Name, Result Value ...
select 
ppf.employee_number,
ppf.full_name,
period_name,
pet.element_name,
prrv.result_value
from
per_all_people_f ppf,
pay_element_types_f pet,
apps.pay_input_values_f piv,
pay_run_result_values prrv,
pay_run_results prr,
pay_payroll_actions ppa,
pay_assignment_actions paa,
pay_element_classifications pec,
per_time_periods ptp,
per_all_assignments_f paf,
pay_payrolls_f pay,
per_periods_of_service ppos
where 1=1 and
ppf.person_id=paf.person_id and
paf.assignment_id=paa.assignment_id and
piv.name='Pay Value' and
prrv.input_value_id=piv.input_value_id and
piv.element_type_id=pet.element_type_id(+) and
prr.run_result_id=prrv.run_result_id and
paa.payroll_action_id=ppa.payroll_action_id and
prr.assignment_action_id=paa.assignment_action_id and
pet.element_type_id=prr.element_type_id and
ppa.action_type in ('Q','R') and
pet.classification_id=pec.classification_id and
ptp.time_period_id=ppa.time_period_id(+) and
pay.payroll_id=paf.payroll_id and
ppos.person_id=ppf.person_id and
ptp.payroll_id=paf.payroll_id and
nvl (ppa.date_earned, ppa.effective_date) between pet.effective_start_date and pet.effective_end_date and
nvl (ppa.date_earned, ppa.effective_date) between piv.effective_start_date and piv.effective_end_date and
nvl (ppa.date_earned, ppa.effective_date) between paf.effective_start_date and paf.effective_end_date and
nvl (ppa.date_earned, ppa.effective_date) between ppf.effective_start_date and ppf.effective_end_date and
upper(pet.element_name) like '%COMMISSION%'