Add Syntax Highlighting
As a Model Builder, I would like to have "syntax highlighting" when I create my formulas in order to improve readability.
Comments
-
Jeremy,
Thanks for the idea and screenshot. We are moving your idea to 'acknowledged'. We encourage the Community to provide addtional feedback and support for the idea.
0 -
I can't stress enough how important this would be to all model builders on the team. I would only like to point out that while the colorful highlighting is nice to have, the ability to add new line & indent while reading or editing the formula (similarly to how formulas are currently displayed when using Drill Down) would drastically improve readability by itself. This would be a huge quality of life improvement as going back to edit/read/understand/rewrite lengthy formulas would become much easier.
0 -
Status changed to: Delivered0
-
This is also on my personal wishlist. Something to be able to more easily read through nested IF statements, and other more complex formulas would be great. I also really want the indention that is shown in the screenshot. Here is my personal screenshot for what it's worth.
0 -
Fully agree with this huge improvement even we recommand to limit the length of formula in some case we can do differently.
0 -
100% agree with Jeremy and David. Imagine reading a book on a continuous scroll, with all of the paragraph and
line breaks removed. That's the best analogy I can think of for the current editor.
0 -
Hi everyone
It will be helpful to have the arguments of a formula in a bubble (see the screenshot) while using that formula into the formula bar (much like in Excel). This will make understanding and learning easy.
Regards,
Patrick
1 -
Status changed to: Delivered0
-
Completely agree with the above. A lot of model builders come from a world familiar with MS Excel which is still dramatically better in the formula writing area than Anaplan is currently when it comes to ease of use.
0 -
I want to add another important enhancement to formula editor. For long formulas (1+ word pages) it is quite necessary to have in-text comments, as in other programming languages. So for example everything between $some symbols$ is ignored by system, but visible to modeler and thus helps with development and support.
0 -
Agree
0 -
Will be extremely useful, mostly when a model is big and a small error in the formula syntax can take some minutes!
0 -
Agreed! It would be helpful if the tab spacing was preserved.
As a workaround I made my own color mapping to use in Notepad++ . For larger complex builds, I do all my formula writing in Notepad++ then paste it into Anaplan so that way I have a library of line formulas to view and debug. If anyone is interested in the formatting file for Notepad++ I can send it.
0 -
R language syntax highlighting in Mac Vim
I also use an external editor (Mac Vim) to get color coding; I just tell it the file is in the R language; I ought to build a custom file to improve how it looks, however, because right now it is very rudimentary and dependent on the use of quotes. If you could upload the Notepad++ color settings (in some form), I am sure Windows model builders would appreciate it.
PS. In a module, /data/drill down will format a formula with white space including line breaks for easier readability -- but all black and white.
0 -
Doesn't seem to be a file upload function on community. If anyone wants to load it, paste this code into Notepad and save the file with an .xml extension. You can then import this as a user defined language in Notepad++.
For the dark background in my screen shot I use the dracula theme: https://draculatheme.com/notepad-plus-plus/
<NotepadPlus>
<UserLang name="Anaplan" ext="anaplan" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00" 01 02" 03 04</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
<Keywords name="Numbers, extras1"></Keywords>
<Keywords name="Numbers, extras2"></Keywords>
<Keywords name="Numbers, suffix1"></Keywords>
<Keywords name="Numbers, suffix2"></Keywords>
<Keywords name="Numbers, range"></Keywords>
<Keywords name="Operators1">ABS ADDMONTHS ADDYEARS AGENTS AGENTSB ANSWERTIME ARRIVALRATE AVGDURATION AVGWAIT BLANK CODE COLLECT COMPARE CUMULATE CURRENTPERIODEND CURRENTPERIODSTART CURRENTVERSION DATE DAYSINMONTH DAY DAYS DAYSINYEAR DECUMULATE DIVIDE END ERLANG-B ERLANG-C EXP FIND FINDITEM FIRSTNONBLANK FIRSTNONZERO FV HALFYEARTODATE HALFYEARVALUE INPERIOD IRR ISACTUALVERSION ISANCESTOR ISBLANK ISBLANK ISCURRENTVERSION ISFIRSTOCCURRENCE ISNOTBLANK ISNOTBLANK ITEM LAG LASTNONBLANK LEAD LEFT LEN LENGTH LN LOG LOOKUP LOWER MAILTO MAKELINK MAX MID MIN MOD MONTH MONTHTODATE MONTHVALUE MOVINGSUM MROUND NAME NEXT NEXTVERSION NPER NPV OFFSET PARENT PERIOD PMT POST POWER PREVIOUS PREVIOUSVERSION PROFILE PV QUARTERTODATE QUARTERVALUE RANK RANKCUMULATE RATE RIGHT ROUND SELECT LOOKUP SIGN SLA SPREAD SQRT START SUM SUM & LOOKUP SUM & SELECT TEXT TEXTLIST TIMESUM UPPER VALUE WEEKDAY WEEKTODATE WEEKVALUE YEAR YEARTODATE YEARVALUE ( )</Keywords>
<Keywords name="Operators2"></Keywords>
<Keywords name="Folders in code1, open"></Keywords>
<Keywords name="Folders in code1, middle"></Keywords>
<Keywords name="Folders in code1, close"></Keywords>
<Keywords name="Folders in code2, open"></Keywords>
<Keywords name="Folders in code2, middle"></Keywords>
<Keywords name="Folders in code2, close"></Keywords>
<Keywords name="Folders in comment, open"></Keywords>
<Keywords name="Folders in comment, middle"></Keywords>
<Keywords name="Folders in comment, close"></Keywords>
<Keywords name="Keywords1">IF
NOT
THEN
ELSE
TRUE
AND
OR
<
>
<>
<=
>=

</Keywords>
<Keywords name="Keywords2">+
-
*
/
=</Keywords>
<Keywords name="Keywords3"></Keywords>
<Keywords name="Keywords4"></Keywords>
<Keywords name="Keywords5"></Keywords>
<Keywords name="Keywords6"></Keywords>
<Keywords name="Keywords7"></Keywords>
<Keywords name="Keywords8"></Keywords>
<Keywords name="Delimiters">00[ 01 02] 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" fgColor="FFFFFF" bgColor="000000" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="COMMENTS" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="LINE COMMENTS" fgColor="FF8080" bgColor="000000" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="NUMBERS" fgColor="FFFFFF" bgColor="000000" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS1" fgColor="FFFF00" bgColor="000000" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS2" fgColor="FF962D" bgColor="000000" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="OPERATORS" fgColor="00FF80" bgColor="000000" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN COMMENT" fgColor="FFFFFF" bgColor="000000" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS1" fgColor="CAFFFF" bgColor="000000" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
</Styles>
</UserLang>
</NotepadPlus>0 -
Aside from coloring, another thing I really like about Notepad++ is the ability to set up parenthesis color matching. When I put my cursor next to a parenthesis it'll highlight the matching open and close. This is super handy when I have gnarly nested IF functions or many logical arguments in a formula. If Anaplan has syntax highlighting in the works please include this feature!
0 -
When editing a formula, if you click the drop down/pivot double area have the formula display with indents for if-then-else statements, row numbers, and coloring (if possible allow adding in comments).
Making clear what is a key word, what is a module, line item, when/where brackets/parenthesis begin and end, and auto-fill when you start typing out names of each piece (eg. I start typing Time, with a T and all the module names, lists, and key words start to populate as a list below that is click able)1 -
Status changed to: Delivered0
-
Status changed to: Delivered0
-
Status changed to: Delivered0
-
When entering a formula or you have completed a formula and line items references by it are highlighted or shading in a conditional format when in the formula bar - similar to excel. This would really help when you have similarly named line items or really long formulae.
2 -
Status changed to: Delivered0
-
Status changed to: Delivered0
-
Look in attached picture for example showcasing the problem -> How it works in excel. Look for syntax within red circle.
0 -
Status changed to: Delivered0
-
Hi,
I believe this would be a very impactful tool for model builders and power users. The idea is to help write or verify a formula. In its most basic form, the tool would auto-indent formulas just like in an app like xcode:
IF
X = Y
AND
BooleanVariable
THEN
VariableX[
LOOKUP : LineItem
]
ELSE
VariableY[
SUM : LineItem
]
A little version of that is already available in the drill-down functionality. In fact, I tell clients to use the drill-down functionality to check their formulas. If only the basic indentation of the drill-down menu would appear when you re-open the formula input field, already this would be a big improvement. Then if colors are added, it would make it even better. I suspect, doing this may require a level of syntax check as you enter the formula. This would go hand in hand with several other requests to check the syntax before submitting a formula, one of which is already on the roadmap:
A sort of formula builder that helps you structure a formula, analyze an existing large formula, and check the syntax would save a lot of time.
There are a few browser plug-ins circulating, to help with basic indentation of IF statements, which highlights the need for such a tool.
Thank you,
20 -
We are looking at what we can do in this area!
0 -
Status changed to: Delivered0
-
There is a third-party chrome plugin available made by a french consulting company. I fully agree that this should be incorporated into the platform but untill that is the case the chrome plugin really works for me. It includes indentation and color coding and even fills your formulas (when you start typing). You can find it on: https://chrome.google.com/webstore/detail/a%20-for-anaplan-model-buil/najhicgfojolaebaoccdbopmobcdhpgi
0
Get Started with Idea Exchange
See our Submission Guidelines and Idea Evaluation Criteria, then start posting your own ideas and showing support for others!