0

我有一个有效的 MDX 语句,但我想扩展它。当前的语句带回了特定年份的前 10 名,其中行是州,列是总收入。我想生成 5 列——每列和行集代表不同的年份。我将如何实现这一目标?

  with
  member measures.[Total Earnings] as 
  (measures.[Total GS]) + (measures.[Total DE]) + (measures.[Total SE])
    set [Top 10 States] as
    topcount 
  (
    {Stores.[State Code]. [State Code].members},
     10,
     (Measures.[Total Earnings], [Time].[C Year].[2011])
  )
  select
   {([Measures].[Total  Earnings])} on columns,
     {[Top 10 States]} on rows
    from LoyaltyMeasurements
     Where (Time.[C Year].[2011]);
4

1 回答 1

0

我认为您正在寻找的功能是 ParallelPeriod

MEMBER measures.[Total Earnings Prev1] as 
    Aggregate(
    ParallelPeriod([Time].[C Year], 1, [Time].CurrentMember),
    (measures.[Total GS]) + (measures.[Total DE]) + (measures.[Total SE])
    )
于 2012-12-18T18:35:57.457 回答