1

如何为度量有条件的查询创建缓存,还有其他更好的方法吗?

每次结果在 6 秒内返回,我想让它小于 2 秒

    WITH MEMBER TotalPaidHigh AS SUM   
(   
Filter (    
     {    
        [Employee].[EmployeeID].Members},   
        [Measures].[Score] <= 4 AND    
           [Measures].[Score] >= 1   
            }   
        ),   
    [Measures].[PaidAmount]    
)
MEMBER TotalPaidLow AS   
(
    ([Measures].[PaidAmount]) - (TotalPaidHigh)   
)   
SELECT   
{    
    TotalPaidHigh, TotalPaidLow   
} ON 0   
FROM     
    [Cube]     
WHERE   
(      
  {   
        [Date].[Month].&[April 2011],   
    [Date].[Month].&[May 2011],    
    [Date].[Month].&[June 2011]    
  }    
  ,[Geography].[State].&[NY]    
)  
4

1 回答 1

0

最好的方法是将 PaidHigh 定义为多维数据集中的附加物理度量。然后,该度量的预聚合值将由 Analysis Services 缓存,并且它只需要对聚合结果进行最终计算 - 这很快。

于 2013-08-12T16:15:00.113 回答