Add Syntax Highlighting

As a Model Builder, I would like to have "syntax highlighting" when I create my formulas in order to improve readability.

Tagged:
219
219 votes

Delivered · Last Updated

«1

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.  

  • 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.

  • Status changed to: Delivered
  • 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.

    Anaplan - Formula Syntax.PNG

  • Fully agree with this huge improvement even we recommand to limit the length of formula in some case we can do differently.

     

  • 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.

  • 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

  • Status changed to: Delivered
  • 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.

  • 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.

  • Will be extremely useful, mostly when a model is big and a small error in the formula syntax can take some minutes! 

  • 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.

    Capture.JPG

  • R language syntax highlighting in Mac VimR 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.drill down.png

     

  • 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&quot; 01 02&quot; 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 &amp; LOOKUP SUM &amp; 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&#x000D;&#x000A;NOT&#x000D;&#x000A;THEN&#x000D;&#x000A;ELSE&#x000D;&#x000A;TRUE&#x000D;&#x000A;AND&#x000D;&#x000A;OR&#x000D;&#x000A;&lt;&#x000D;&#x000A;&gt;&#x000D;&#x000A;&lt;&gt;&#x000D;&#x000A;&lt;=&#x000D;&#x000A;&gt;=&#x000D;&#x000A;&#x000D;&#x000A;</Keywords>
    <Keywords name="Keywords2">+&#x000D;&#x000A;-&#x000D;&#x000A;*&#x000D;&#x000A;/&#x000D;&#x000A;=</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>
  • 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!parenthesis matching.JPG

     

     

  • 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)

  • Status changed to: Delivered
  • Status changed to: Delivered
  • Status changed to: Delivered
  • 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.

  • Status changed to: Delivered
  • Status changed to: Delivered
  • Look in attached picture for example showcasing the problem -> How it works in excel. Look for syntax within red circle.

  • Status changed to: Delivered
  • Love this suggestion @Ari !

  • We are looking at what we can do in this area!

  • Status changed to: Delivered
  • 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 

Get Started with Idea Exchange


See our Submission Guidelines and Idea Evaluation Criteria, then start posting your own ideas and showing support for others!