Databases Reference
In-Depth Information
Remember the
FIX
and
ENDFIX
commands are best used on
Sparse
Dimension
due to the physical construction of the Essbase cube. Well,
the opposite is recommended for the
IF
and
ENDIF
commands. Because
the
IF
statement needs to test every occurrence of the data brought to it,
it is best to use the
IF
and
ENDIF
commands against a
Dense
Dimension
because there will be fewer cells of data that need to be tested since the
original subset of data was pulled in as a
Sparse
Dimension
.
For example:
FIX(Sparse Dimension)
IF(Dense Dimension)
Any Calculation Function;
ENDIF
ENDFIX
Again, while this is not always possible, it is a good idea to follow this
recommendation whenever possible.
Just like the
FIX
and
ENDFIX
commands, the
IF
and
ENDIF
commands can be nested.
We have never been able to determine if there is a limit, but we have also never
hit a limit when coding either. For every
IF
statement, there must be a matching
ENDIF
statement. When using
ELSE
or
ELSEIF
, you will still need one
ENDIF
for
every
IF
statement.
For example:
IF(Conditional Argument)
Any Calculation Function;
ENDIF
Or this:
IF(Conditional Argument)
IF(Conditional Argument)
Any Calculation Function;
ELSEIF(Conditional Argument)
Any Calculation Function;
ELSE
Any Calculation Function;
ENDIF
ENDIF
Also, like the
FIX
and
ENDFIX
commands, the
IF
and
ENDIF
command statements
do not need to be terminated with a semi-colon. Only the actionable calculation
function statements need to be terminated by a semi-colon.