AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • In-Person Gatherings
    • Power BI Workshop
    • Podcast
    • Rolodex
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
Nested iif statemen...
 
Notifications
Clear all

Questions Nested iif statements issue

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Laura Carpenter 4 years ago
3 Posts
2 Users
2 Reactions
2,886 Views
RSS
Laura Carpenter
Posts: 10
 Laura Carpenter
Topic starter
May 11, 2022 12:41 pm
(@lauracarpenter)
Active Member
Joined: 5 years ago

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'))))))))))


2 Replies
Patrick Kohler
Posts: 24
 Patrick Kohler
May 11, 2022 12:50 pm
(@pmkohler)
Eminent Member
Joined: 6 years ago

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


Reply
Laura Carpenter reacted
Laura Carpenter
Posts: 10
 Laura Carpenter
Topic starter
May 11, 2022 2:53 pm
(@lauracarpenter)
Active Member
Joined: 5 years ago

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')


Reply
Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,528 Topics
  • 10.9 K Posts
  • 68 Online
  • 2,414 Members
Our newest member: Megan Pawlowski
Latest Post: Credit Reference Report Needed
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

  • russ Terry Payne Cory Miller
Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2026 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×