(case when pay_basis like 'HOURLY'
when pay_basis like 'ANNUAL'
I was actually trying to write the logic in this way but it was not calculating in correct format for hourly paid employees
The issue is because your annualization factor will also change based on your salary basis.
Example for monthly salary - USD 1000 your annual factor = monthly salary * 12
for Hourly salary - USD 25 you annual factor = hourly salary * 365
Change the value of pay_annualization_factor as per the pay_basis and you will get the correct value.