Write good formulas in Adaptive

Mastering the Art of Formula Writing in Workday Adaptive Planning

Have you ever encountered a formula in Workday Adaptive Planning that seemed like a cryptic puzzle that made your eyes sting or cry? We've all been there. While formulas are the backbone of powerful models, poorly written ones can hinder understanding, efficiency, and maintainability.

To ensure your formulas are clear, concise, and easy to comprehend, let's explore these four essential principles:

1. Use and abuse the SPACE BAR (talking about keyboard here!)

Just as a well-formatted document is easier to read, a formula with ample white spacing is easier to decipher too! This simple technique will significantly improve the redability.

  • Visual Cues: Use spaces between operators, functions, and variables to visually separate elements. DontwriteyourformulaslikethisbasicallyOK?
  • Here is an example of a formula that calculates the benefits for a fulltime employee whether they are USA based or International: 
🥺 SKIBIDI

iff(ROW.EmployeeType="FTE",iff(ROW.Country="USA",ASSUM.BenefitsAmount_USA,ASSUM.BenefitsAmount_International)*ROW.Headcount,0)

A little better:

iff (ROW.EmployeeType = "FTE", iff (ROW.Country = "USA", ASSUM.BenefitsAmount_USA, ASSUM.BenefitsAmount_International) * ROW.Headcount, 0)

2. Leverage Line Breaks

  • Modularize Your Formulas: Break down complex formulas into smaller, more manageable chunks by using line breaks to separate logical sections. This technique helps you and others grasp the formula's intent more quickly.
Much better:

iff (ROW.EmployeeType = "FTE", 
iff (ROW.Country="USA", 
ASSUM.BenefitsAmount_USA, 
ASSUM.BenefitsAmount_International) * ROW.Headcount, 0)

 

3. Employ Indentation

  • Hierarchical Organization: Indent nested expressions to visually represent their hierarchy.
  • This technique highlights the relationship between different parts of the formula and makes debugging much faster! For example we can see more easily what IF statement a closing parenthesis is related to!
Fantastamazing:

iff (ROW.EmployeeType = "FTE", 
        iff (ROW.Country="USA", 
                ASSUM.BenefitsAmount_USA,  
                ASSUM.BenefitsAmount_International 
        ) * ROW.Headcount,  
         
)

 

4. Harness the Power of Comments

  • Explain Your Intent: Use comments to clarify the purpose of specific parts of your formula.
  • Future-Proof Your Work: Comments help others (and your future self) understand the rationale behind your choices.
  • Best Practices: Add comments to complex calculations, non-obvious logic, and any assumptions made.
  • In Workday Adaptive, start your comments with the # symbol. Anything after a # symbol until you press Enter is considered a comment and is not interpreted by the formula.

🤩 GOATED! 

# Benefits for Fulltime employees only, else 0 
iff (ROW.EmployeeType = "FTE", 
        iff (ROW.Country="USA", 
                ASSUM.BenefitsAmount_USA,               # USA Benefits Amount
                ASSUM.BenefitsAmount_International   # Other Countries
        ) * ROW.Headcount,  
                                                                                # else 0 for non fulltimers
)


Beyond the Basics

For more in-depth guidance on formula writing, consult the Workday Adaptive Planning Help Guide.

Need Expert Assistance?

Please reach out!


By adhering to these principles, you can create formulas that are not only functional but also elegant and fluid. Remember, well-written formulas are a testament to your modeling prowess and a valuable asset to your organization.

Check my video if you don't like reading!



Comments

Popular posts from this blog

Adaptive REST API Calls for Platform Customers with User Sync Enabled

Introduction to Adaptive's API

What is OAuth 2.0 and how to set it up in Adaptive?