2.02-12 No Hardcoding to List members
Avoid direct references to list item. E.g. IF ITEM(list)=list.xx. Instead, attempt to use a SYS module with a line item having a boolean format as this makes the formula more dynamic (multiple members can use the same logic).
Comments
-
Rule 2.02-12 No Hardcoding to List Members. Avoid direct references to list item. E.g. IF ITEM(list) = list.xx. It goes against SUSTAINABLE elements of PLANS if you wish to go against this rule
Here is how it was done in Pre Planual Era:
Hardcoding to list items used to be a norm. For example I had to write IF Account 1 then 1, IF Account 2 OR Account 3 then 2 and IF Account 4 & 5 then 3.
Formula might look like
What is wrong with this method?
For Production Lists: You will not be able to make this list as Production List, if need arises in the future, compromising your ALM settings
For Non Production Lists: Maintaining this is extremely laborious and tricky. You have to check all the references of that particular list in the model and change it manually everywhere. Any change in the list item’s logic or addition of list item which shares the logic with any other list item are few examples/cases
Here is how it should be done in Planual Way:
Step 1: Create a module dimensioned by GL Accounts List and Insert as many line items as there are logics to be written against. Check the Accounts in their respective buckets i.e., Account 1 in Logic 1, Account 2 and 3 in Logic 2 and rest in Logic 3
Step 2: Refer the above Boolean formatted line items instead of list items in your formula
1 -
Hello @rob_marshall, I want to know is there any impact on performance if we directly refer non-production list member in our formula rather than referring it from a system module with same list formatted line item. Please find below screenshot for more clarity:-
1.One way :- IF Account Coverage = Account Coverage.'Federal - DOD' THEN 'SYS 05'.FED DOD[LOOKUP: Zip Code] ELSE IF Account Coverage = Account Coverage.'Federal - Civilian' THEN 'SYS 05'.FED CIVILIAN[LOOKUP: Zip Code] ELSE IF Account Coverage = Account Coverage.'Federal - Healthcare' THEN 'SYS 05'.FED HEALTHCARE[LOOKUP: Zip Code] ELSE Blank
2. Second way: -IF Account Coverage = 'SYS 21 : Formula References'.'Federal - DOD' THEN 'SYS 05'.FED DOD[LOOKUP: Zip Code] ELSE IF Account Coverage = 'SYS 21 : Formula References'.'Federal - Civilian' THEN 'SYS 05'.FED CIVILIAN[LOOKUP: Zip Code] ELSE IF Account Coverage = 'SYS 21 : Formula References'.'Federal - Healthcare' THEN 'SYS 05'.FED HEALTHCARE[LOOKUP: Zip Code] ELSE Blank
-Is there any performance improvement if we use second way of writing?
-Is there any other benefits using the second way other than flexibility to change list as production in future?
1 -
Form a lookup perspective, no, but from a calculation perspective, absolutely. It would be better to create a SYS module for Account Coverage and have a mapping line item (called Zip Code) with the zip codes defined for Federal - DOD, Federal - Civilian, and Federal - Healthcare. So the formula would be:
SYS Account Coverage.Zip Code[lookup:Account Coverage]
The less IF statements the better. Remember, the if statement has 3 different calcs, the IF part, the THEN part, and the ELSE part. If you can minimize those, the formula would be better.
You want to stay away from hardcoding as much as possible as it limits the scalability of your model.
0
Title
- Preface
- PLANS
- Planual Conventions
- Zen of Anaplan
- Chapter 1 - Central Library
- Time
- Versions
- Users and Roles
- Contents
- Lists
- Subsets
- Line Item Subsets
- Emojis
- Chapter 2 - Engine
- Modules
- Formulas
- Line Items
- Saved Views
- Chapter 3 - UX Principles
- Hierarchy of Information
- Smart Grouping
- Reduce Visual Load
- Progressive Disclosure
- Use Consistency and Standards
- Provide Help and Guidance
- Use The Correct Data Type
- Give Users Visibility Into Status
- Match With Real World Scenarios
- Check In With End Uses Frequently
- Chapter 4 - UX Build
- Apps
- Dashboards
- Filters
- Chapter 5 - Integration
- Actions
- Processes
- Source Models
- Imports
- Exports
- Import Data Sources
- Data Hub
- Chapter 6 - Application Lifecycle Management
- Revision Tags
- Production Lists
- Architecture
- Deployed Mode
- Managing Changes During Development
- Chapter 7 - Extensions
- Excel
- PowerPoint