By using this website, you agree to our Terms of Use (click here)
I have a GI that I am attempting to define the specific GL account based on the employee's department ID. I am successful with the formula as I have it shown below but the issue is that I have 2 more departments that are not included in this formula. I have been receiving this error message: "Case expressions may only be nested to level 10." I am assuming that means I can't have more than 10 nested iif statements. Any one run into this and have a creative solution?
My working iif statement:
=iif([EPEmployee.DepartmentID]='ACCTG','670.011.5040', iif([EPEmployee.DepartmentID]='CNSTR','630.002.5040', iif([EPEmployee.DepartmentID]='DRAFT','631.005.5040', iif([EPEmployee.DepartmentID]='ENGRG','631.006.5040', iif([EPEmployee.DepartmentID]='ESTMG','670.004.5040', iif([EPEmployee.DepartmentID]='GRAGE','630.008.5040', iif([EPEmployee.DepartmentID]='HURSC','670.010.5040', iif([EPEmployee.DepartmentID]='INFTC','670.012.5040', iif([EPEmployee.DepartmentID]='MNFCT','630.001.5040', iif([EPEmployee.DepartmentID]='PMGMT','631.007.5040', '630.003.5040'))))))))))
Laura,
Have you tried using the Switch function instead?
You might also consider setting up your defaults in the Departments under Organization under the Configuration workspace.
Patrick
The switch function worked perfectly! That was my first time using that and it was very handy. The defaults on our departments wouldn't work because this group of department GL codes is for one specific expense type and that wouldn't match with the GL accounts that we have on our departments. Here is the formula that worked for me (in case anyone else is curious and not experienced with this formula).
=Switch(([EPEmployee.DepartmentID]='ACCTG'),'670.011.5040',([EPEmployee.DepartmentID]='ADMIN'),'670.009.5040',([EPEmployee.DepartmentID]='CNSTR'),'630.002.5040',([EPEmployee.DepartmentID]='DRAFT'),'631.005.5040',([EPEmployee.DepartmentID]='ENGRG'),'631.006.5040',([EPEmployee.DepartmentID]='ESTMG'),'670.004.5040',([EPEmployee.DepartmentID]='GRAGE'),'630.008.5040',([EPEmployee.DepartmentID]='HURSC'),'670.010.5040',([EPEmployee.DepartmentID]='INFTC'),'670.012.5040',([EPEmployee.DepartmentID]='MNFCT'),'630.001.5040',([EPEmployee.DepartmentID]='PMGMT'),'631.007.5040',([EPEmployee.DepartmentID]='QUALT'),'630.003.5040',([EPEmployee.DepartmentID]='SLLNG'),'670.004.5040')
