Skipping Empty Tuples to Optimize Custom Calculations

Optimize custom calculation rules by using the NONEMPTYTUPLE keyword to skip calculations for empty tuples.

To avoid calculating empty result sets, you can use the NONEMPTYTUPLE property clause in custom calculation formulas. NONEMPTYTUPLE restricts where the system attempts to calculate. Define a member or tuple that is evaluated only when it is not empty, followed by the numeric expression to apply.

Syntax

The syntax for using NONEMPTYTUPLE is as follows:

</ResultMember/> = NONEMPTYTUPLE </NonemptyMemberOrTuple/> numeric_value_expression

Where:

  • </ResultMember/> is the single Level 0 member to which the result is written.
  • NONEMPTYTUPLE is an optional property that optimizes calculation performance.
  • </NonemptyMemberOrTuple/> is the member or tuple to evaluate. It must also be present in the numeric value expression.
  • numeric_value_expression is a simple MDX numeric value expression that uses arithmetic operators.

NONEMPTYTUPLE can be applied only when the right side of the equation contains a member or tuple to evaluate. It does not apply when the right side contains only a constant value.

The expression must be on the right side of the equation. Use only arithmetic operators. An error is returned if non-arithmetic operators, such as AND, OR, or IF, are used.

Examples:

The following examples show formulas with and without NONEMPTYTUPLE:

  • A constant value - NONEMPTYTUPLE does not apply because the right side contains no member or tuple:

    </Adjustment In/> = 100
  • A single member:

    </Adjustment In/> = </Input/> * 0.15

    Rewritten using NONEMPTYTUPLE:

    </Adjustment In/> = NONEMPTYTUPLE </Input/> </Input/> * 0.15
  • A tuple:

    </Adjustment In/> = </Input,2013,Budget/> * 1.15

    Rewritten using NONEMPTYTUPLE:

    </Adjustment In/> = NONEMPTYTUPLE </Input,2013,Budget/>
                                               </Input,2013,Budget/> * 1.15

When the specified member or tuple contains a value, the calculation is performed. When it is empty, the calculation is skipped.