MDX 销售额与上月比较

with  member [RatioToAll] as
 '[Measures].[Sale Num List]/([Measures].[Sale Num List],[Ga View Publisher Info].[出版社名称].[All])',FORMAT_STRING = '0.00%'  
 member [LastMonthSalesNumList] as
  ([Measures].[Sale Num List],[Dim Time2].[YearMonth].PREVMEMBER)
 member [CompareLastMonth] as
  ([LastMonthSalesNumList] - [Measures].[Sale Num List])
 
select
      {[Measures].[Sale Num],[Measures].[Sale Num List],[RatioToAll],
       [LastMonthSalesNumList],[CompareLastMonth]}  on 0,
      order(
         crossjoin(
                 {[Dim Time2].[YearMonth].&[200501]:[Dim Time2].[YearMonth].&[200503]},
                 {[Ga View Publisher Info].[出版社名称].Members} ) ,
                 [Measures].[Sale Num List], desc)      
                 on 1
              
from [Open Book Data View]

posted on 2007-12-20 16:50  YZG  阅读(235)  评论(0编辑  收藏  举报

导航