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.
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:
|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 to which this member belongs.
|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.
|(Optional) Controls how the values are displayed. See Specifying a Format String.
|(Optional) Indicates the units in which the measure value is expressed. Currently this attribute is provided only for general information.
|(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.
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.