Class CalculatedMember (Excel VBA)

The class CalculatedMember represents the calculated fields, calculated items, and named sets for PivotTables with Online Analytical Processing (OLAP) data sources.

Member in collection

Item

To use a CalculatedMember class variable it first needs to be instantiated, for example

Dim clcm as CalculatedMember
Set clcm = ActiveCell.PivotTable.CalculatedMembers(Index:=1)

The following procedures can be used to set variables of type CalculatedMember: CalculatedMembers.Add, CalculatedMembers.AddCalculatedMember and CalculatedMembers.Item.

For Each

Here is an example of processing the CalculatedMember items in a collection.

Dim clcm As CalculatedMember
For Each clcm In ActiveCell.PivotTable.CalculatedMembers
	
Next clcm

Delete - Deletes the object.

CalculatedMembers.Add - Adds a calculated field or calculated item to a PivotTable. Returns a CalculatedMember object.

CalculatedMembers.AddCalculatedMember - Adds a calculated field or calculated item to a PivotTable.

Properties

Name (Default member) - Returns a String value that represents the name of the object. CalculatedMembers.Item (Default member) - Returns a single object from a collection.

DisplayFolder returns the display folder name for a named set.

Dynamic returns whether the specified named set is recalculated with every update.

FlattenHierarchies returns or sets whether items from all levels of the hierarchy of the specified named set are displayed in the same field of a PivotTable report based on an OLAP cube.

Formula returns a String value that represents the member's formula in multidimensional expressions (MDX) syntax.

HierarchizeDistinct returns or sets whether to order and remove duplicates when displaying the hierarchy of the specified named set in a PivotTable report based on an OLAP cube.

IsValid returns a Boolean that indicates whether the specified calculated member has been successfully instantiated with the OLAP provider during the current session.

MeasureGroup returns the associated measure group.

NumberFormat returns an XlCalcMemNumberFormatType value that represents the number format of the calculated member. The default value is xlNumberFormatTypeDefault.

ParentHierarchy returns the name of the current parent hierarchy from the hierarchies that are available on the cube.

ParentMember returns the name of the parent member for the parent hierarchy.

SolveOrder returns a Long specifying the value of the calculated member's solve order MDX (Mulitdimensional Expression) argument. The default value is zero.

SourceName returns a String value that represents the specified object's name as it appears in the original source data for the specified PivotTable report.

Type returns an XlCalculatedMemberType value that represents the calculated member type.

CalculatedMembers.Count returns a Long value that represents the number of objects in the collection.