Indented view of long if statement

Highlighted
New Contributor

Indented view of long if statement

How to get a neat indented version of a long IF Else statement. Other than the drill down that one can do within Anaplan, it doesnt work every time.

2 REPLIES 2
Highlighted
Community Boss

RE: Indented view of long if statement

Using Drill down is th eonly way that I know of that allows you to do this.  I will often use Notepad or another text editor sometimes to write out longer If then statements and space them out.  If you just have spaces, anaplan will remove them and tighten it up once you enter the formula in the formula bar. Thanks, Chris
Highlighted
Regular Contributor

RE: Indented view of long if statement

The drilldown view is very helpful, but it's not a good idea to copy that text out and paste it back in, because the drilldown view deletes some parentheses that would change the meaning of your formula. For example, if you have a formula like
Sales + (IF Include Optional Adjustments? THEN Optional Adjustments ELSE 0) + Mandatory Adjustments
the drilldown viewer will display this as Sales + IF Include Optional Adjustments? THEN Optional Adjustments ELSE 0 + Mandatory Adjustments ...which if you capy & paste it back into Anaplan ends up as
Sales + IF Include Optional Adjustments? THEN Optional Adjustments ELSE 0 + Mandatory Adjustments
Note the missing brackets around the IF statement. The result is different too; the original version always added the mandatory adjustments, but the new version only adds them when the optional adjustments are switched off. So I'd advise caution when copying & pasting from the drilldown view.