Mdx 如何覆盖SSAS商业智能&x27;货币兑换';用于负债计算
我正在AnalysisServices中设置一个新的多维数据集,并使用商业智能向导解决货币转换问题。现在,这一切都完美地工作了,钱在叶子级别被转换,并汇总起来显示在用户选择的报表货币中 我现在的问题是责任的计算。对于负债,我需要将每种货币的金额相加,然后使用最新的“日终汇率”进行转换。我将“日终率”作为最后一个非空指标,但我看不出如何避免叶级转换,如下所示:Mdx 如何覆盖SSAS商业智能&x27;货币兑换';用于负债计算,mdx,ssas,Mdx,Ssas,我正在AnalysisServices中设置一个新的多维数据集,并使用商业智能向导解决货币转换问题。现在,这一切都完美地工作了,钱在叶子级别被转换,并汇总起来显示在用户选择的报表货币中 我现在的问题是责任的计算。对于负债,我需要将每种货币的金额相加,然后使用最新的“日终汇率”进行转换。我将“日终率”作为最后一个非空指标,但我看不出如何避免叶级转换,如下所示: // This is the Many to One section // All currency conversion formu
// 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
[货币]计量单位以不同的货币支付,每种货币都有一个货币维度和一个“日终汇率”
我计算负债的最佳方案是什么?我正在考虑复制[货币]度量值,但为了避免货币转换而增加额外度量值似乎是浪费——此外,在真实立方体中,还有几个度量值需要计算,因此它不仅仅是额外的度量值
其他人也面临类似的问题吗?好吧,所以我最终创建了一个不可见的[Measures].[Money-Liability],它不是由上述代码自动转换的,我在脚本中完成了以下计算:
[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]))
);