Export (0) Print
Expand All
Avg
IIf
Lag
Max
Min
Mtd
Qtd
Sum
Var
Wtd
Ytd
Expand Minimize

AddCalculatedMembers (MDX)

Updated: 17 July 2006

Returns a set generated by adding calculated members to a specified set.


AddCalculatedMembers(Set_Expression) 

Set_Expression

A valid Multidimensional Expressions (MDX) expression that returns a set.

By default, MDX excludes calculated members when it resolves set functions. The AddCalculatedMembers function examines the set expression specified in Set_Expression, and includes calculated members that are siblings of the members contained within the scope of that set expression.

ms146077.note(en-US,SQL.90).gifNote:
This function can be used only with one-dimensional set expressions.

The following example demonstrates the use of this function.

-- This query returns the calculated members for the cube
-- by retrieving all members, and then excluding non-calculated members.
SELECT 
   AddCalculatedMembers(
      {[Measures].Members}
      )-[Measures].Members ON COLUMNS,
   [Product].[Product Name].Members ON ROWS
FROM [Adventure Works] 

The following example returns the Measures.[Unit Price] member, in addition to all the calculated members in the Measures dimension, from the Adventure Works cube.

SELECT
   AddCalculatedMembers({Measures.[Unit Price]}) ON COLUMNS,
   Product.Product.Children ON ROWS
FROM 
   [Adventure Works]

Release History

17 July 2006

Changed content:
  • Updated syntax and arguments to improve clarity.
  • Added updated examples.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft