0

我有下面的 CUBESET 函数,它生成按数量排序的位置国家(名称)集,效果很好。我需要相同但使用多个月。我在下面的公式中添加的每个月都会乘以我收到的成员列表。因此,如果我再添加一个月,那么我会收到一份国家列表,如“美国、美国、德国、德国……”。我只需要收到一次。应该有一个计算,首先将所有月份的数量相加,然后根据每个国家的总数量对所有月份进行排序。

=CUBESET("Connection_to_OLAP";" 
         (
           [Customer].[Customer No].[All].[100]
          ,[Date].[Calendar Year].[All].[2017]
          ,[Date].[Calendar Month Of Year No].[All].[01]
         ,{[Location].[Location Country Code].children})";"Country";1;"([Measures].[Quantity])")
4

1 回答 1

0

如果您创建一个类似于以下内容的自定义成员:

Aggregate(
  [Date].[Calendar Year].[All].[2017] 
  * {[Date].[Calendar Month Of Year No].[All].[01], [Date].[Calendar Month Of Year No].[All].[02]}
)

以上可以称为“TwoMonthsAgg”。

然后您CUBESET将更改为:

=CUBESET("Connection_to_OLAP";" 
         (
           [Customer].[Customer No].[All].[100]
          ,[Date].[All].[TwoMonthsAgg]
         ,{[Location].[Location Country Code].children})";"Country";1;"([Measures].[Quantity])")
于 2017-04-26T10:47:36.947 回答