danielw.au
Registered User.
- Local time
- , 10:19
- Joined
- Mar 12, 2014
- Messages
- 10
Hi Everyone,
I'm wanting some advice on how to optimise a query expression.
I have the below query that determines the employees rate, based on which bracket their total income falls into.
I'm concerned that I have not writting this expression in the most efficient manner and would appreciate any suggestions.
SepEmployeeIncomeTaxRate: IIf([SepEmployeeTotalIncome] Between [Sep_Txl_TaxGroup1_Min] And [Sep_Txl_TaxGroup1_Max],[Sep_Txl_TaxGroup1_Rate],IIf([SepEmployeeTotalIncome] Between [Sep_Txl_TaxGroup2_Min] And [Sep_Txl_TaxGroup2_Max],[Sep_Txl_TaxGroup2_Rate],IIf([SepEmployeeTotalIncome] Between [Sep_Txl_TaxGroup3_Min] And [Sep_Txl_TaxGroup3_Max],[Sep_Txl_TaxGroup3_Rate],IIf([SepEmployeeTotalIncome] Between [Sep_Txl_TaxGroup4_Min] And [Sep_Txl_TaxGroup4_Max],[Sep_Txl_TaxGroup4_Rate],IIf([SepEmployeeTotalIncome] Between [Sep_Txl_TaxGroup5_Min] And [Sep_Txl_TaxGroup5_Max],[Sep_Txl_TaxGroup5_Rate],0)))))
Thank you
daniel
I'm wanting some advice on how to optimise a query expression.
I have the below query that determines the employees rate, based on which bracket their total income falls into.
I'm concerned that I have not writting this expression in the most efficient manner and would appreciate any suggestions.
SepEmployeeIncomeTaxRate: IIf([SepEmployeeTotalIncome] Between [Sep_Txl_TaxGroup1_Min] And [Sep_Txl_TaxGroup1_Max],[Sep_Txl_TaxGroup1_Rate],IIf([SepEmployeeTotalIncome] Between [Sep_Txl_TaxGroup2_Min] And [Sep_Txl_TaxGroup2_Max],[Sep_Txl_TaxGroup2_Rate],IIf([SepEmployeeTotalIncome] Between [Sep_Txl_TaxGroup3_Min] And [Sep_Txl_TaxGroup3_Max],[Sep_Txl_TaxGroup3_Rate],IIf([SepEmployeeTotalIncome] Between [Sep_Txl_TaxGroup4_Min] And [Sep_Txl_TaxGroup4_Max],[Sep_Txl_TaxGroup4_Rate],IIf([SepEmployeeTotalIncome] Between [Sep_Txl_TaxGroup5_Min] And [Sep_Txl_TaxGroup5_Max],[Sep_Txl_TaxGroup5_Rate],0)))))
Thank you
daniel