Skip to main content

<calculatedMember>

Defines an optional calculated member, which is a member that is defined in terms of other members (of a level in a Business Intelligence cube).

Details

You can add two kinds of calculated member:

  • You can define a new measure that is based on other measures. For example, you can define a measure via a formula like the following:

    Measure 3 = (Measure 1 + Measure 2) / Measure 2)
    

    This is not the exact syntax.

  • You can define a new member that is based on other non-measure members. For example, you could create a Primary Colors member that combines the red, yellow, and blue members of the Favorite Color dimension.

    The new Primary Colors member refers to all the records of the fact table that correspond to the red, yellow, or blue members.

In MDX, a measure is considered to be a member, which is why both kinds of calculated elements are considered to be calculated members.

Note:

When you use this element to define a measure, the cube command in the MDX shell does not currently list this measure. You can, however, use the set in the MDX shell or in the query API.

The <calculatedMember> element has the following contents:

Attribute Purpose
name, displayName, description, disabled See Common Attributes in a Cube . For the name attribute, the system does not check whether the name is already in use. If you use a name that was previously used by another member of this dimension, you are overriding that member.
dimension Dimension to which this member belongs.
valueExpression MDX expression that defines the values for this member in terms of references to other members. For simple but common scenarios, see Defining Calculated Elements. For details and examples, see the InterSystems MDX Reference.
formatString (Optional) Controls how the values are displayed. See Specifying a Format String.
units (Optional) Indicates the units in which the measure value is expressed. Currently this attribute is provided only for general information.
listingFilter (Optional, applies only if dimension is "measures") Specifies an additional filter that is used when a user displays this calculated measure in a pivot table and then requests a detail listing. See Specifying Additional Filtering for Listings for a Calculated Measure.
Note:

You can define a calculated member in two other ways:

  • Within an MDX query by using the WITH clause.

  • Within the CREATE MEMBER statement.

    This is useful only within the MDX Shell.

See the InterSystems MDX Reference.

Example

For example:

<calculatedMember name="Avg Age" dimension="MEASURES" valueExpression="[MEASURES].[Age]/[MEASURES].[%COUNT]"/>

In any context where you use this calculated member, the system first evaluates the Age and Patient Count measures in that context and then performs the division.

FeedbackOpens in a new tab