Skip to content

calc/exclude-balance

Severity error by default. It runs on calc-script bodies (.csc) in Rules, Templates, and Scripts, and needs nothing but the file you have open.

Every EXCLUDE( in the body is paired with an ENDEXCLUDE, counting nesting. An opener left unclosed is flagged at the EXCLUDE( itself; a closer with nothing above it is flagged at the ENDEXCLUDE. Keywords in comments or inside quoted strings are ignored, and matching is case-insensitive. This is a separate rule from calc/fix-balance so you can adjust one pairing without touching the other.

Essbase refuses to run a script whose EXCLUDE is unbalanced, and the parse failure that comes back from Calculation Manager tends to name the end of the body rather than the opener. EXCLUDE blocks are usually short and nested inside a FIX, which makes a missing closer easy to skim past when you are reading the slice above it.

FIX( "Plan", "FY Total" )
EXCLUDE( "No Entity" )
"Net Income" = "Revenue" - "Total Expenses";
ENDFIX

The EXCLUDE is never closed, so the finding lands on line 2:

This `EXCLUDE(` has no matching `ENDEXCLUDE`.

The reverse case, an ENDEXCLUDE with no opener above it, reads:

This `ENDEXCLUDE` has no matching `EXCLUDE(`.

Corrected:

FIX( "Plan", "FY Total" )
EXCLUDE( "No Entity" )
"Net Income" = "Revenue" - "Total Expenses";
ENDEXCLUDE
ENDFIX

Change its severity or turn it off in the Validation Rules panel, or exempt one artifact with an Exception. A Template or Script that deliberately opens an EXCLUDE its parent Rule closes is the usual reason to reach for an Exception rather than a severity change.