SELECT { [ Time ] . [ Sep,2005 ] : [ Time ] . [ Oct,2007 ] } on columns, { [ Product ] . [ Tools ] : [ Product ] . [ Home Audio ] } on rows FROM [ Sales ] WHERE ( [ Customer ] . [ Lubbock, TX ] , [ Measures ] . [ Unit Sales ] )
SELECT { [ Scenario ] .Members } on columns, { [ Store ] .Members } on rows FROM Budgeting
当一个客户使用.Members(或是其他可以返回和响应的成员集合的元数据函数),分析服务和Essbase都不会包括任何被计算过的成员。在分析服务中还提供了AddCalculatedMembers()和.AddMembers函数来向集合中加入成员。
.Children
另一种使用频率非常高的选择方法就是获得成员的孩子(children)。我们可以使用下钻的操作,或者是简单地获得一个基于parent的成员的范围。MDX提供了一个.Children函数,这个函数将为我们实现这个功能。下面的MDX语句将在rows上选择[Product].[Tools]的成员和它的Children,代码如下:
SELECT { [ Time ] . [ Q3, 2005 ] .Children } on columns, { [ Product ] . [ Tools ] , [ Product ] . [ Tools ] .Children } on rows FROM Sales WHERE ( [ Customer ] . [ TX ] , [ Measures ] . [ Unit Sales ] )
{ [ Product ] . [ Tools ] , [ Product ] . [ Toys ] } ON COLUMNS, Descendants ( [ Time ] . [ 2007 ] , [ Time ] . [ Month ] , SELF_AND_BEFORE ) ON ROWS FROM Sales WHERE [ Measures ] . [ Dollar Sales ]