Filter MDX-如何;总结;经过筛选的结果集

Filter MDX-如何;总结;经过筛选的结果集,filter,aggregate,mdx,Filter,Aggregate,Mdx,我正在努力确定正确的MDX查询语法,以便在移动过滤器以支持高级嵌套过滤后返回预期的结果集 下面的查询是今天生成的内容,屏幕截图显示了结果。根据下面的查询,是否有人对如何获得屏幕截图中描述的所需结果有任何见解 注意-我认为过滤器需要保持在原来的位置,以便支持嵌套的复杂过滤器。i、 e.((A=1或B1或C=2))| |(B=3和C=4) 与 将AllRowsSet设置为 { 滤器 ( 非空 ( 叫做城市。[叫做城市],孩子们* 称为国家。[称为国家名称].儿童* 账单月数。[账单月数]。儿童* s

我正在努力确定正确的MDX查询语法,以便在移动过滤器以支持高级嵌套过滤后返回预期的结果集

下面的查询是今天生成的内容,屏幕截图显示了结果。根据下面的查询,是否有人对如何获得屏幕截图中描述的所需结果有任何见解

注意-我认为过滤器需要保持在原来的位置,以便支持嵌套的复杂过滤器。i、 e.((A=1或B1或C=2))| |(B=3和C=4)

与
将AllRowsSet设置为
{
滤器
(
非空
(
叫做城市。[叫做城市],孩子们*
称为国家。[称为国家名称].儿童*
账单月数。[账单月数]。儿童*
sources\U pivot\U v1.[source\U name\U l1]。子项*
products\u pivot。[product\u name\u l1]。子项*
products\u pivot。[product\u name\u l2]。子项
,{
[措施][实际持续时间]
,[措施][金额]
}
)
,
计费月份。[计费月份].CurrentMember.Member\u标题='201805'
和products\u pivot。[product\u name\u l1]。CurrentMember.Member\u Caption='Usage'
和products\u pivot。[product\u name\u l2]。CurrentMember.Member\u Caption='LD International'
并称为_countries。[称为_country _name].CurrentMember.Member _标题“TEST _NULL”
及(
sources\u pivot\u v1.[source\u name\u l1].CurrentMember.Member\u Caption='Company for Joint'
或sources\u pivot\u v1。[source\u name\u l1]。CurrentMember.Member\u Caption='Cisco呼叫管理器'
)
)
}
成员[Measures].totalrows作为AllRowsSet.Count
成员[度量].[称为城市]称为城市。[称为城市].CurrentMember.MEMBER\u标题
成员[度量].[称为国家/地区名称]称为国家/地区。[称为国家/地区名称].CurrentMember.MEMBER\u标题
成员[度量].[计费月]作为计费月。[计费月].CurrentMember.MEMBER\u标题
成员[Measures]。[source\u name\u l1]作为源[source\u pivot\u v1.[source\u name\u l1].CurrentMember.MEMBER\u标题
成员[MEASURE].[product\U name\U l1]作为产品轴。[product\U name\U l1].CurrentMember.MEMBER\U标题
成员[MEASURE].[product\U name\U l2]作为products\U pivot.[product\U name\U l2].CurrentMember.MEMBER\U Caption
挑选
{
[措施][实际持续时间]
,[措施][金额]
,[Measures]。总计行数
,[措施][称为城市]
,[Measures]。[称为国家名称]
,[措施][计费月]
,[Measures]。[source\u name\u l1]
,[措施][产品名称]
,[Measures]。[product\u name\u l2]
}柱上
,子集
(
命令
(
滤器
(
非空
(
叫做城市。[叫做城市],孩子们*
称为国家。[称为国家名称].儿童*
账单月数。[账单月数]。儿童*
sources\U pivot\U v1.[source\U name\U l1]。子项*
products\u pivot。[product\u name\u l1]。子项*
products\u pivot。[product\u name\u l2]。子项
,{
[措施][实际持续时间]
,[措施][金额]
}
)
,
计费月份。[计费月份].CurrentMember.Member\u标题='201805'
和products\u pivot。[product\u name\u l1]。CurrentMember.Member\u Caption='Usage'
和products\u pivot。[product\u name\u l2]。CurrentMember.Member\u Caption='LD International'
并称为_countries。[称为_country _name].CurrentMember.Member _标题“TEST _NULL”
及(
sources\u pivot\u v1.[source\u name\u l1].CurrentMember.Member\u Caption='Company for Joint'
或sources\u pivot\u v1。[source\u name\u l1]。CurrentMember.Member\u Caption='Cisco呼叫管理器'
)
)
,[措施][金额]
,BDESC
)
,0
,250
)成排
从…起
(
从呼叫中选择0上的{计费月数。[v1\u已禁用].[v1\u已禁用]。&[0]}
);

要进行聚合,您可以- 1.将ON行集移动到WITH子句中 2.把它包在一起 3.您需要在多维数据集中找到此查询中未使用的“备用”维度以创建此新自定义成员:

WITH
  SET AllRowsSet AS
    {
      Filter
      (
        NonEmpty
        (
            called_cities.[called_city].Children*
            called_countries.[called_country_name].Children*
            billing_months.[billing_month].Children*
            sources_pivot_v1.[source_name_l1].Children*
            products_pivot.[product_name_l1].Children*
            products_pivot.[product_name_l2].Children
            ,{
                [Measures].[actual_duration]
                ,[Measures].[amount]
            }
        )
       ,
        billing_months.[billing_month].CurrentMember.Member_Caption = '201805'
        AND products_pivot.[product_name_l1].CurrentMember.Member_Caption = 'Usage'
        AND products_pivot.[product_name_l2].CurrentMember.Member_Caption = 'LD International'
        AND called_countries.[called_country_name].CurrentMember.Member_Caption <> 'TEST_NULL'
        AND (
            sources_pivot_v1.[source_name_l1].CurrentMember.Member_Caption = 'Company for Joint'
            OR sources_pivot_v1.[source_name_l1].CurrentMember.Member_Caption = 'Cisco Call Manager'
        )
      )
    }
  MEMBER [Measures].totalrows AS AllRowsSet.Count
  MEMBER [Measures].[called_city] AS called_cities.[called_city].CurrentMember.Member_Caption
  MEMBER [Measures].[called_country_name] AS called_countries.[called_country_name].CurrentMember.Member_Caption
  MEMBER [Measures].[billing_month] AS billing_months.[billing_month].CurrentMember.Member_Caption
  MEMBER [Measures].[source_name_l1] AS sources_pivot_v1.[source_name_l1].CurrentMember.Member_Caption
  MEMBER [Measures].[product_name_l1] AS products_pivot.[product_name_l1].CurrentMember.Member_Caption
  MEMBER [Measures].[product_name_l2] AS products_pivot.[product_name_l2].CurrentMember.Member_Caption

MEMBER [SpareDimension].[SpareHierarchy].[myAggregation] AS   //<< REPLACE <[SpareDimension].[SpareHierarchy]> WITH A VALID DIMENSION/HIERARCHY IN YOUR CUBE THAT IS NOT BEING USED IN THE SCRIPT
Aggregate(
SubSet
  (
    Order
    (
      Filter
      (
        NonEmpty
        (
            called_cities.[called_city].Children*
            called_countries.[called_country_name].Children*
            billing_months.[billing_month].Children*
            sources_pivot_v1.[source_name_l1].Children*
            products_pivot.[product_name_l1].Children*
            products_pivot.[product_name_l2].Children
         ,{
            [Measures].[actual_duration]
           ,[Measures].[amount]
          }
        )
       ,
        billing_months.[billing_month].CurrentMember.Member_Caption = '201805'
        AND products_pivot.[product_name_l1].CurrentMember.Member_Caption = 'Usage'
        AND products_pivot.[product_name_l2].CurrentMember.Member_Caption = 'LD International'
        AND called_countries.[called_country_name].CurrentMember.Member_Caption <> 'TEST_NULL'
        AND (
            sources_pivot_v1.[source_name_l1].CurrentMember.Member_Caption = 'Company for Joint'
            OR sources_pivot_v1.[source_name_l1].CurrentMember.Member_Caption = 'Cisco Call Manager'
        )
      )
     ,[Measures].[amount]
     ,BDESC
    )
   ,0
   ,250
  )
)
SELECT
  {
    [Measures].[actual_duration]
  } ON COLUMNS
 ,[SpareDimension].[SpareHierarchy].[myAggregation] ON ROWS
FROM
(
  SELECT {billing_months.[v1_disabled].[v1_disabled].&[0]} ON 0 FROM calls
);
与
将AllRowsSet设置为
{
滤器
(
非空
(
叫做城市。[叫做城市],孩子们*
称为国家。[称为国家名称].儿童*
账单月数。[账单月数]。儿童*
sources\U pivot\U v1.[source\U name\U l1]。子项*
products\u pivot。[product\u name\u l1]。子项*
products\u pivot。[product\u name\u l2]。子项
,{
[措施][实际持续时间]
,[措施][金额]
}
)
,
计费月份。[计费月份].CurrentMember.Member\u标题='201805'
和products\u pivot。[product\u name\u l1]。CurrentMember.Member\u Caption='Usage'
和products\u pivot。[product\u name\u l2]。CurrentMember.Member\u Caption='LD International'
并称为_countries。[称为_country _name].CurrentMember.Member _标题“TEST _NULL”
及(
sources\u pivot\u v1.[source\u name\u l1].CurrentMember.Member\u Caption='Company for Joint'
或sources\u pivot\u v1。[source\u name\u l1]。CurrentMember.Member\u Caption='Cisco呼叫管理器'
)
)
}
成员[Measures].totalrows作为AllRowsSet.Count
成员[度量].[称为城市]称为城市。[称为城市].CurrentMember.MEMBER\u标题
成员[度量].[称为国家/地区名称]称为国家/地区。[称为国家/地区名称].CurrentMember.MEMBER\u标题
成员[度量].[计费月]作为计费月。[计费月].CurrentMember.MEMBER\u标题
成员[Measures]。[source\u name\u l1]作为源[source\u pivot\u v1.[source\u name\u l1].CurrentMember.MEMBER\u标题
成员[MEASURE].[product\U name\U l1]作为产品轴。[product\U name\U l1].CurrentMember.MEMBER\U标题
成员[MEASURE].[product\U name\U l2]作为products\U pivot.[product\U name\U l2].CurrentMember.MEMBER\C
WITH
  SET AllRowsSet AS
    {
      Filter
      (
        NonEmpty
        (
            called_cities.[called_city].Children*
            called_countries.[called_country_name].Children*
            billing_months.[billing_month].Children*
            sources_pivot_v1.[source_name_l1].Children*
            products_pivot.[product_name_l1].Children*
            products_pivot.[product_name_l2].Children
            ,{
                [Measures].[actual_duration]
                ,[Measures].[amount]
            }
        )
       ,
        billing_months.[billing_month].CurrentMember.Member_Caption = '201805'
        AND products_pivot.[product_name_l1].CurrentMember.Member_Caption = 'Usage'
        AND products_pivot.[product_name_l2].CurrentMember.Member_Caption = 'LD International'
        AND called_countries.[called_country_name].CurrentMember.Member_Caption <> 'TEST_NULL'
        AND (
            sources_pivot_v1.[source_name_l1].CurrentMember.Member_Caption = 'Company for Joint'
            OR sources_pivot_v1.[source_name_l1].CurrentMember.Member_Caption = 'Cisco Call Manager'
        )
      )
    }
  MEMBER [Measures].totalrows AS AllRowsSet.Count
  MEMBER [Measures].[called_city] AS called_cities.[called_city].CurrentMember.Member_Caption
  MEMBER [Measures].[called_country_name] AS called_countries.[called_country_name].CurrentMember.Member_Caption
  MEMBER [Measures].[billing_month] AS billing_months.[billing_month].CurrentMember.Member_Caption
  MEMBER [Measures].[source_name_l1] AS sources_pivot_v1.[source_name_l1].CurrentMember.Member_Caption
  MEMBER [Measures].[product_name_l1] AS products_pivot.[product_name_l1].CurrentMember.Member_Caption
  MEMBER [Measures].[product_name_l2] AS products_pivot.[product_name_l2].CurrentMember.Member_Caption

MEMBER [SpareDimension].[SpareHierarchy].[myAggregation] AS   //<< REPLACE <[SpareDimension].[SpareHierarchy]> WITH A VALID DIMENSION/HIERARCHY IN YOUR CUBE THAT IS NOT BEING USED IN THE SCRIPT
Aggregate(
SubSet
  (
    Order
    (
      Filter
      (
        NonEmpty
        (
            called_cities.[called_city].Children*
            called_countries.[called_country_name].Children*
            billing_months.[billing_month].Children*
            sources_pivot_v1.[source_name_l1].Children*
            products_pivot.[product_name_l1].Children*
            products_pivot.[product_name_l2].Children
         ,{
            [Measures].[actual_duration]
           ,[Measures].[amount]
          }
        )
       ,
        billing_months.[billing_month].CurrentMember.Member_Caption = '201805'
        AND products_pivot.[product_name_l1].CurrentMember.Member_Caption = 'Usage'
        AND products_pivot.[product_name_l2].CurrentMember.Member_Caption = 'LD International'
        AND called_countries.[called_country_name].CurrentMember.Member_Caption <> 'TEST_NULL'
        AND (
            sources_pivot_v1.[source_name_l1].CurrentMember.Member_Caption = 'Company for Joint'
            OR sources_pivot_v1.[source_name_l1].CurrentMember.Member_Caption = 'Cisco Call Manager'
        )
      )
     ,[Measures].[amount]
     ,BDESC
    )
   ,0
   ,250
  )
)
SELECT
  {
    [Measures].[actual_duration]
  } ON COLUMNS
 ,[SpareDimension].[SpareHierarchy].[myAggregation] ON ROWS
FROM
(
  SELECT {billing_months.[v1_disabled].[v1_disabled].&[0]} ON 0 FROM calls
);