2010-02-17 37 views
0

我在Analysis Services中設置了一個新的多維數據集,並使用商業智能嚮導來計算貨幣換算問題。現在,這一切都可以完美運行,貨幣會在葉級轉換並彙總顯示在用戶選擇的報告貨幣中。如何覆蓋SSAS商業智能「貨幣換算」以計算責任

我現在的問題是責任的計算。對於責任,我需要總結每種貨幣的貨幣,然後使用最近的「日收盤價」進行轉換。我有節率結束「作爲LastNonEmpty措施,但我不能看到如何避免如下所示的葉級的轉換:

// This is the Many to One section 
// All currency conversion formulas are calculated for the pivot currency and at leaf of the time dimension 
Scope ({ Measures.[Money] }); 
    Scope(Leaves([Date]) ,[Reporting Currency].[GBP], Leaves([Currency])); 

    // Convert Local value into Pivot currency for selected Measures that must be   converted with Measure rate [End Of Day Rate] 
     Scope({ Measures.[Money] }) 
      This = [Reporting Currency].[Local] * Measures.[End Of Day Rate]; 
     End Scope; 
    End Scope;  

    // This is the One to Many section 
    // All currency conversion formulas are calculated for the non pivot currency and at leaf of the time dimension 
    Scope(Leaves([Date]) , Except([Reporting Currency].[Currency].[Currency].Members, {[Reporting Currency].[Currency].[Currency].[GBP], [Reporting Currency].[Currency].[Currency].[Local]})); 

    // This section overrides the local values with the Converted value for each selected measures needing to be converted with Measure rate [End Of Day Rate]… 
    // LinkMember is used to reference the currency from the source currency dimension in the rate cube. 
    Scope({ Measures.[Money] }); 
     This = [Reporting Currency].[Currency].[GBP]/(Measures.[End Of Day Rate], LinkMember([Reporting Currency].[Currency].CurrentMember, [Currency].[Currency])); 
    End Scope; 

    End Scope; // Leaves of time, all reporting currencies but local and pivot currency 
End Scope; // Measures 

的[錢]度量支付在不同的貨幣,並且每種貨幣都鍵入貨幣維度和「日收盤價」。

我計算責任的最佳計劃是什麼?我正在考慮複製[Money]措施,但爲避免貨幣轉換而採取額外措施似乎很浪費 - 此外,在真實立方體中,還有幾個措施需要計算,因此它不僅僅是額外的一。

其他人都遇到過類似的事情嗎?

回答

1

行,所以我結束了創建一個無形的[措施] [錢 - 責任]這是不是自動轉換通過上面的代碼,我結束了在腳本以下計算:

[Measures].[Liability] = 
(
    SUM 
    ([Currency].[Currency].[Currency], 
     SUM 
     ( 
      { NULL : [Date].[Date Key].CurrentMember }, 
      ( 
       [Money - Liability] 
      ) 
    ) 
    /[Measures].[End Of Day Rate] 
    ) 
    * (Measures.[End Of Day Rate], LinkMember([Reporting Currency].[Currency].CurrentMember, [Currency].[Currency])) 
);