Better Formula Editor for Anaplan; A new Chrome/Firefox/Edge Extension

GeorgeDuckett
Regular Contributor

Better Formula Editor for Anaplan; A new Chrome/Firefox/Edge Extension

Hello all!

I have made a Google Chrome and Firefox extension that enhances Anaplan formula editing by using the Monaco editor. This is the editor used by Anaplan's new modelling experience. My extension works with this new experience adding enhancements over and above what Anaplan have done. It also works with the current/old formula editing experience; it's best in the new experience though.

Chrome: https://chrome.google.com/webstore/detail/better-formula-editor-for/lonibgccfehnjjhchfcbdhkaajhobeak
Firefox: https://addons.mozilla.org/en-GB/firefox/addon/better-formula-editor-anaplan/
Edge: https://microsoftedge.microsoft.com/addons/detail/better-formula-editor-for/dkeigmhhjolcnnanpachagca...
(Once added be sure to reload any open anaplan tabs)

Details below:

  • Formula Validation: Various checks are performed on formulas including simple things like ensuring all entities are named / referenced correctly or ensuring the correct data types are used throughout the formula, through to things like checking for dimension miss-matches when referring to line items with different dimensions.
  • Formula Formatting: Provides basic formatting for valid formulas; breaking up IF...THEN....ELSE onto multiple lines with proper indentation.
  • Hover Information: You can hover your mouse over most elements of a formula to get contextual information, for example hovering over line items shows their dimensions and data type and hovering over function names to get information about that function.
  • Quick Fixes: When errors are encountered the extension will allow the user to choose an appropriate fix from a menu which when chosen would make the required changes to the formula automatically.
  • Code Completion: As you are typing the editor will offer auto-complete suggestions for things like line items within the current module, fully qualified line items within other modules, function names etc.
  • Function Information: When completing functions with parentheses you get popup contextual information relating to the parameters of the function together with an explanation of both the function and the parameters.
  • Shortcuts: Standard Monaco editor shortcuts apply. Ctrl-Space; Open code completion. Ctrl-Shift-Space; Open function info (when within function parentheses). Shift-Alt-F for formatting.

The extension is under active development; currently next on the list is intelligent autocomplete suggestions for lookups required when referencing line items with different dimensions. Something like suggesting "LOOKUP: PROP C10 ItemCustomer.P6 Item" when pressing "[" after a relevant line item.

EDIT: The above is now in this extension. Pressing "[" on a line item with dimensions that the current line item doesn't have will prompt it to work out a reasonable suggestion (based on your usage on other formulas) and suggest those LOOKUP/Aggregations as autocompletes.

 

Please let me know what you think; I'm very open to further ideas!

If you like my work you can support me here, via the GitHub sponsorship program.

48 REPLIES 48
GeorgeDuckett
Regular Contributor

Thanks, hope it helps!
GeorgeDuckett
Regular Contributor

I've added a new feature, QuickFixesWhen errors are encountered the extension will allow the user to choose an appropriate fix from a menu which when chosen would make the required changes to the formula automatically.

johnabooth
New Contributor

Good day George, I see you have an option to donate for Open Source projects.  Is your extension open source and if so may we see the repository URL?

Kind Regards,

John A. Booth

johnabooth
New Contributor
chilled0ut
Contributor

This is awesome! Been using and promoting it to the rest of our company. One thing that would be really great is if it can detect data type issues when you are passing a parameter to a function such as lookup or sum. You know how Anaplan takes a long time to tell you when you've entered an incorrect data type when calling a lookup or sum function. It would greatly improve productivity if the add-on can provide an advance warning (e.g. like highlight parameter in bright red background) when a model builder has passed the wrong data type as parameter to the function. 

GeorgeDuckett
Regular Contributor

I assume you mean stopping you doing a SUM on a boolean etc. Great idea. I do currently check parameters for bracket functions and LOOKUP, but could also make sure SUM and other aggregate functions. If you've found a case I've missed, please let me know.
GeorgeDuckett
Regular Contributor

@chilled0ut I've had a look at what I'm doing in that area, and I already do a few checks. I'm checking the type of aggregate function (SUM/ALL/TEXTLIST) against the entity it's ran against, to ensure the type of entity matches it. I'm also checking the dimensions of the entity and the line item to ensure the formula covers all required mappings (with a LOOKUP/SUM/Other aggregate function as appropriate). If there's some case that is not covered I'd love to hear about it so I can add in an extra check.

chilled0ut
Contributor

@GeorgeDuckett hey ... actually you are right. You are doing it already. Wrote that when I was still getting familiar with the tool. So it highlights it in red underscore if you passed the wrong parameter as per example below. Just another thought for improvement. When you start displaying the list of line items to select from (second screenshot), limit the line items to select to be only the valid ones for that aggregate function, in the example below it would be C10, hence the user wouldn't even get see the other line items that would generate an error. But the tool is pretty awesome as it is. Anaplan should probably buy it off you and make it part of their standard IDE. 

😉 😉 @rob_marshall @JaredDolich @Misbah 

chilled0ut_0-1660032469624.png

chilled0ut_1-1660032702795.png

 

 

GeorgeDuckett
Regular Contributor

@chilled0ut Thanks for the praise! Yeah, that is on the list. I was thinking of maybe just preferring valid options, rather than completely removing invalid ones. It's probably less confusing to not have an invalid one on the list, but if you select it have it highlighted as an error, rather than users wondering why it won't autocomplete.