Google Chrome Extension to make long formulas easier to read
I created the chrome extension Anaplan Formulator to make long formulas easier to read in the native formula editor. The extension inserts a return before and after each IF, THEN, and ELSE in the formula. Please take a look and let me know what you think!
Just added and will be giving it a try! Did you create it? Any plans/thoughts on adding more functionality to it?3
Thanks for sharing! I've also just added this extension, will take a look.
I'm used to copy-paste formula from a drilldown view to sublime text with C syntax. It helps with some complicated formulas.
Hi @bdeaton, thank you for trying it out! I am the author. As of right now these are my goals for this project:
Short term - Create a GitHub page and publish as open source. I have high hopes for this project and believe the best way to see them come to fruition is to publish as free and open source.
Long term - Adding indentation functionality to make code look pretty. This feels like the next logical step in the extensions life.
Extremely long term - Fully functioning code editor. This would be really cool...lets see what happens.
Let me know if there is anything you would like added to the extension!
Wow I didn't even know this existed. Will definitely check it out, Thanks!0
"you should be able to explain the formula in a simple sentence"
"the formula should not take more space than the formula editor box"
If either of these is not true, then the formula is too big and should be broken up!!!
"simple is better than complex"
Thanks Ryan! Will definitely check this out.1
I do tend to agree that formulas should often be broken up if they are complex, but this is sometimes a battle against size issues in some models and longer/complex formulas is sometimes (but not always) the best option to limit space requirements.
Looking at our models, we probably should simplify in a lot of cases. But, as with almost anything, there are trade-offs to be considered.
Even simple IF/THEN formulas can benefit from the spacing that this add-in provides, however. So I still think it does have value. And for formulas that are already written and need to be simplified, I could see where this add-in might help to more easily identify the different pieces that could be pulled into separate line items to get back to a place where formulas are simpler.6
I don't disagree!
I do think that anything that helps build better formula and understand existing formulas is welcome. Certainly the latter; where we are trying to simplify and optimise2
@RyanMonique I've been using the add-in all day today. It's awesome!1
Great idea! A minor piece of feedback - I have modules names and list items that are being broken up because they contain "if". For example, I have the word "specific" in one of my module names. Maybe a condition in the code to only indent when a space exists before and/or after the keyword?1
Hi @BenHilgendorf ,
Thanks for the feedback and nice catch! I will infidelity take this feedback and add it to my testing routines for future releases.
This was a quick fix and V1.1 of the extension was just published. It searches for "IF ", " THEN ",or " ELSE ". The IF cannot have a space before as some formulas start "IF...." , but the space after should have the same effect as your solution.
@bdeaton, Ah that's great to hear! Please feel free to spread word to any colleagues who may be able to make use of the extension ':)'0
@bdeaton, Ah that's great to hear! Please feel free to spread word to any colleagues who may be able to make use of the extension ":)"0
Really cool, thanks!0
This is amazing! I can't believe I've only just come across this!
But it is also true if the formula is too long then it should be broken down as @DavidSmith says! But the compromise that needs to be made is the sparsity!
However as model builders we need the tools for efficiency!